prisma 6.11.0-dev.29 → 6.11.0-dev.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/README.md +0 -2
  2. package/build/index.js +530 -536
  3. package/build/prisma_schema_build_bg.wasm +0 -0
  4. package/build/schema_engine_bg.wasm +0 -0
  5. package/package.json +14 -14
  6. package/prisma-client/generator-build/index.js +11 -12
  7. package/prisma-client/package.json +4 -5
  8. package/prisma-client/runtime/binary.js +47 -47
  9. package/prisma-client/runtime/binary.mjs +47 -47
  10. package/prisma-client/runtime/client.d.mts +1 -6
  11. package/prisma-client/runtime/client.d.ts +1 -6
  12. package/prisma-client/runtime/client.js +22 -22
  13. package/prisma-client/runtime/client.mjs +22 -22
  14. package/prisma-client/runtime/edge-esm.js +15 -15
  15. package/prisma-client/runtime/edge.d.ts +1 -6
  16. package/prisma-client/runtime/edge.js +15 -15
  17. package/prisma-client/runtime/library.d.mts +1 -6
  18. package/prisma-client/runtime/library.d.ts +1 -6
  19. package/prisma-client/runtime/library.js +38 -38
  20. package/prisma-client/runtime/library.mjs +36 -36
  21. package/prisma-client/runtime/query_engine_bg.mysql.js +2 -2
  22. package/prisma-client/runtime/query_engine_bg.mysql.mjs +1 -1
  23. package/prisma-client/runtime/query_engine_bg.postgresql.js +2 -2
  24. package/prisma-client/runtime/query_engine_bg.postgresql.mjs +1 -1
  25. package/prisma-client/runtime/query_engine_bg.sqlite.js +2 -2
  26. package/prisma-client/runtime/query_engine_bg.sqlite.mjs +1 -1
  27. package/prisma-client/runtime/query_engine_bg.sqlserver.js +2 -2
  28. package/prisma-client/runtime/query_engine_bg.sqlserver.mjs +1 -1
  29. package/prisma-client/runtime/react-native.d.ts +1 -6
  30. package/prisma-client/runtime/react-native.js +21 -21
  31. package/prisma-client/scripts/default-index.js +3 -3
@@ -1,8 +1,8 @@
1
- "use strict";var wc=Object.create;var Wr=Object.defineProperty;var Ec=Object.getOwnPropertyDescriptor;var xc=Object.getOwnPropertyNames;var bc=Object.getPrototypeOf,Pc=Object.prototype.hasOwnProperty;var jo=(e,t)=>()=>(e&&(t=e(e=0)),t);var W=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),ct=(e,t)=>{for(var r in t)Wr(e,r,{get:t[r],enumerable:!0})},Bo=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of xc(t))!Pc.call(e,i)&&i!==r&&Wr(e,i,{get:()=>t[i],enumerable:!(n=Ec(t,i))||n.enumerable});return e};var j=(e,t,r)=>(r=e!=null?wc(bc(e)):{},Bo(t||!e||!e.__esModule?Wr(r,"default",{value:e,enumerable:!0}):r,e)),vc=e=>Bo(Wr({},"__esModule",{value:!0}),e);var ns=W((oy,Hc)=>{Hc.exports={name:"@prisma/internals",version:"6.11.0-dev.29",description:"This package is intended for Prisma's internal use",main:"dist/index.js",types:"dist/index.d.ts",repository:{type:"git",url:"https://github.com/prisma/prisma.git",directory:"packages/internals"},homepage:"https://www.prisma.io",author:"Tim Suchanek <suchanek@prisma.io>",bugs:"https://github.com/prisma/prisma/issues",license:"Apache-2.0",scripts:{dev:"DEV=true tsx helpers/build.ts",build:"tsx helpers/build.ts",test:"dotenv -e ../../.db.env -- jest --silent",prepublishOnly:"pnpm run build"},files:["README.md","dist","!**/libquery_engine*","!dist/get-generators/engines/*","scripts"],devDependencies:{"@babel/helper-validator-identifier":"7.25.9","@opentelemetry/api":"1.9.0","@swc/core":"1.11.5","@swc/jest":"0.2.37","@types/babel__helper-validator-identifier":"7.15.2","@types/jest":"29.5.14","@types/node":"18.19.76","@types/resolve":"1.20.6",archiver:"6.0.2","checkpoint-client":"1.1.33","cli-truncate":"4.0.0",dotenv:"16.5.0",esbuild:"0.25.1","escape-string-regexp":"5.0.0",execa:"5.1.1","fast-glob":"3.3.3","find-up":"7.0.0","fp-ts":"2.16.9","fs-extra":"11.3.0","fs-jetpack":"5.1.0","global-dirs":"4.0.0",globby:"11.1.0","identifier-regex":"1.0.0","indent-string":"4.0.0","is-windows":"1.0.2","is-wsl":"3.1.0",jest:"29.7.0","jest-junit":"16.0.0",kleur:"4.1.5","mock-stdin":"1.0.0","new-github-issue-url":"0.2.1","node-fetch":"3.3.2","npm-packlist":"5.1.3",open:"7.4.2","p-map":"4.0.0","read-package-up":"11.0.0",resolve:"1.22.10","string-width":"7.2.0","strip-ansi":"6.0.1","strip-indent":"4.0.0","temp-dir":"2.0.0",tempy:"1.0.1","terminal-link":"4.0.0",tmp:"0.2.3","ts-node":"10.9.2","ts-pattern":"5.6.2","ts-toolbelt":"9.6.0",typescript:"5.4.5",yarn:"1.22.22"},dependencies:{"@prisma/config":"workspace:*","@prisma/debug":"workspace:*","@prisma/dmmf":"workspace:*","@prisma/driver-adapter-utils":"workspace:*","@prisma/engines":"workspace:*","@prisma/fetch-engine":"workspace:*","@prisma/generator":"workspace:*","@prisma/generator-helper":"workspace:*","@prisma/get-platform":"workspace:*","@prisma/prisma-schema-wasm":"6.11.0-15.f67607f6772d3f263d40c8e233b50714bc8295cc","@prisma/schema-engine-wasm":"6.11.0-15.f67607f6772d3f263d40c8e233b50714bc8295cc","@prisma/schema-files-loader":"workspace:*",arg:"5.0.2",prompts:"2.4.2"},peerDependencies:{typescript:">=5.1.0"},peerDependenciesMeta:{typescript:{optional:!0}},sideEffects:!1}});var os=W((ly,is)=>{"use strict";is.exports=e=>{let t=e.match(/^[ \t]*(?=\S)/gm);return t?t.reduce((r,n)=>Math.min(r,n.length),1/0):0}});var us=W((py,ls)=>{"use strict";ls.exports=(e,t=1,r)=>{if(r={indent:" ",includeEmptyLines:!1,...r},typeof e!="string")throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof e}\``);if(typeof t!="number")throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof t}\``);if(typeof r.indent!="string")throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof r.indent}\``);if(t===0)return e;let n=r.includeEmptyLines?/^/gm:/^(?!\s*$)/gm;return e.replace(n,r.indent.repeat(t))}});var ds=W((my,ps)=>{"use strict";ps.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 fi=W((fy,ms)=>{"use strict";var Xc=ds();ms.exports=e=>typeof e=="string"?e.replace(Xc(),""):e});var fs=W((hy,ep)=>{ep.exports={name:"dotenv",version:"16.5.0",description:"Loads environment variables from .env file",main:"lib/main.js",types:"lib/main.d.ts",exports:{".":{types:"./lib/main.d.ts",require:"./lib/main.js",default:"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},scripts:{"dts-check":"tsc --project tests/types/tsconfig.json",lint:"standard",pretest:"npm run lint && npm run dts-check",test:"tap run --allow-empty-coverage --disable-coverage --timeout=60000","test:coverage":"tap run --show-full-coverage --timeout=60000 --coverage-report=lcov",prerelease:"npm test",release:"standard-version"},repository:{type:"git",url:"git://github.com/motdotla/dotenv.git"},homepage:"https://github.com/motdotla/dotenv#readme",funding:"https://dotenvx.com",keywords:["dotenv","env",".env","environment","variables","config","settings"],readmeFilename:"README.md",license:"BSD-2-Clause",devDependencies:{"@types/node":"^18.11.3",decache:"^4.6.2",sinon:"^14.0.1",standard:"^17.0.0","standard-version":"^9.5.0",tap:"^19.2.0",typescript:"^4.8.4"},engines:{node:">=12"},browser:{fs:!1}}});var Es=W((wy,ke)=>{"use strict";var yi=require("node:fs"),hi=require("node:path"),tp=require("node:os"),rp=require("node:crypto"),np=fs(),ys=np.version,ip=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function op(e){let t={},r=e.toString();r=r.replace(/\r\n?/mg,`
2
- `);let n;for(;(n=ip.exec(r))!=null;){let i=n[1],o=n[2]||"";o=o.trim();let s=o[0];o=o.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),s==='"'&&(o=o.replace(/\\n/g,`
3
- `),o=o.replace(/\\r/g,"\r")),t[i]=o}return t}function sp(e){let t=ws(e),r=B.configDotenv({path:t});if(!r.parsed){let s=new Error(`MISSING_DATA: Cannot parse ${t} for an unknown reason`);throw s.code="MISSING_DATA",s}let n=hs(e).split(","),i=n.length,o;for(let s=0;s<i;s++)try{let a=n[s].trim(),l=lp(r,a);o=B.decrypt(l.ciphertext,l.key);break}catch(a){if(s+1>=i)throw a}return B.parse(o)}function ap(e){console.log(`[dotenv@${ys}][WARN] ${e}`)}function Yt(e){console.log(`[dotenv@${ys}][DEBUG] ${e}`)}function hs(e){return e&&e.DOTENV_KEY&&e.DOTENV_KEY.length>0?e.DOTENV_KEY:process.env.DOTENV_KEY&&process.env.DOTENV_KEY.length>0?process.env.DOTENV_KEY:""}function lp(e,t){let r;try{r=new URL(t)}catch(a){if(a.code==="ERR_INVALID_URL"){let l=new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");throw l.code="INVALID_DOTENV_KEY",l}throw a}let n=r.password;if(!n){let a=new Error("INVALID_DOTENV_KEY: Missing key part");throw a.code="INVALID_DOTENV_KEY",a}let i=r.searchParams.get("environment");if(!i){let a=new Error("INVALID_DOTENV_KEY: Missing environment part");throw a.code="INVALID_DOTENV_KEY",a}let o=`DOTENV_VAULT_${i.toUpperCase()}`,s=e.parsed[o];if(!s){let a=new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${o} in your .env.vault file.`);throw a.code="NOT_FOUND_DOTENV_ENVIRONMENT",a}return{ciphertext:s,key:n}}function ws(e){let t=null;if(e&&e.path&&e.path.length>0)if(Array.isArray(e.path))for(let r of e.path)yi.existsSync(r)&&(t=r.endsWith(".vault")?r:`${r}.vault`);else t=e.path.endsWith(".vault")?e.path:`${e.path}.vault`;else t=hi.resolve(process.cwd(),".env.vault");return yi.existsSync(t)?t:null}function gs(e){return e[0]==="~"?hi.join(tp.homedir(),e.slice(1)):e}function up(e){!!(e&&e.debug)&&Yt("Loading env from encrypted .env.vault");let r=B._parseVault(e),n=process.env;return e&&e.processEnv!=null&&(n=e.processEnv),B.populate(n,r,e),{parsed:r}}function cp(e){let t=hi.resolve(process.cwd(),".env"),r="utf8",n=!!(e&&e.debug);e&&e.encoding?r=e.encoding:n&&Yt("No encoding is specified. UTF-8 is used by default");let i=[t];if(e&&e.path)if(!Array.isArray(e.path))i=[gs(e.path)];else{i=[];for(let l of e.path)i.push(gs(l))}let o,s={};for(let l of i)try{let u=B.parse(yi.readFileSync(l,{encoding:r}));B.populate(s,u,e)}catch(u){n&&Yt(`Failed to load ${l} ${u.message}`),o=u}let a=process.env;return e&&e.processEnv!=null&&(a=e.processEnv),B.populate(a,s,e),o?{parsed:s,error:o}:{parsed:s}}function pp(e){if(hs(e).length===0)return B.configDotenv(e);let t=ws(e);return t?B._configVault(e):(ap(`You set DOTENV_KEY but you are missing a .env.vault file at ${t}. Did you forget to build it?`),B.configDotenv(e))}function dp(e,t){let r=Buffer.from(t.slice(-64),"hex"),n=Buffer.from(e,"base64"),i=n.subarray(0,12),o=n.subarray(-16);n=n.subarray(12,-16);try{let s=rp.createDecipheriv("aes-256-gcm",r,i);return s.setAuthTag(o),`${s.update(n)}${s.final()}`}catch(s){let a=s instanceof RangeError,l=s.message==="Invalid key length",u=s.message==="Unsupported state or unable to authenticate data";if(a||l){let c=new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");throw c.code="INVALID_DOTENV_KEY",c}else if(u){let c=new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");throw c.code="DECRYPTION_FAILED",c}else throw s}}function mp(e,t,r={}){let n=!!(r&&r.debug),i=!!(r&&r.override);if(typeof t!="object"){let o=new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");throw o.code="OBJECT_REQUIRED",o}for(let o of Object.keys(t))Object.prototype.hasOwnProperty.call(e,o)?(i===!0&&(e[o]=t[o]),n&&Yt(i===!0?`"${o}" is already defined and WAS overwritten`:`"${o}" is already defined and was NOT overwritten`)):e[o]=t[o]}var B={configDotenv:cp,_configVault:up,_parseVault:sp,config:pp,decrypt:dp,parse:op,populate:mp};ke.exports.configDotenv=B.configDotenv;ke.exports._configVault=B._configVault;ke.exports._parseVault=B._parseVault;ke.exports.config=B.config;ke.exports.decrypt=B.decrypt;ke.exports.parse=B.parse;ke.exports.populate=B.populate;ke.exports=B});var vs=W((Ty,Zr)=>{"use strict";Zr.exports=(e={})=>{let t;if(e.repoUrl)t=e.repoUrl;else if(e.user&&e.repo)t=`https://github.com/${e.user}/${e.repo}`;else throw new Error("You need to specify either the `repoUrl` option or both the `user` and `repo` options");let r=new URL(`${t}/issues/new`),n=["body","title","labels","template","milestone","assignee","projects"];for(let i of n){let o=e[i];if(o!==void 0){if(i==="labels"||i==="projects"){if(!Array.isArray(o))throw new TypeError(`The \`${i}\` option should be an array`);o=o.join(",")}r.searchParams.set(i,o)}}return r.toString()};Zr.exports.default=Zr.exports});var Ri=W((Xh,Ws)=>{"use strict";Ws.exports=function(){function e(t,r,n,i,o){return t<r||n<r?t>n?n+1:t+1:i===o?r:r+1}return function(t,r){if(t===r)return 0;if(t.length>r.length){var n=t;t=r,r=n}for(var i=t.length,o=r.length;i>0&&t.charCodeAt(i-1)===r.charCodeAt(o-1);)i--,o--;for(var s=0;s<i&&t.charCodeAt(s)===r.charCodeAt(s);)s++;if(i-=s,o-=s,i===0||o<3)return o;var a=0,l,u,c,p,d,m,g,y,I,A,C,w,O=[];for(l=0;l<i;l++)O.push(l+1),O.push(t.charCodeAt(s+l));for(var me=O.length-1;a<o-3;)for(I=r.charCodeAt(s+(u=a)),A=r.charCodeAt(s+(c=a+1)),C=r.charCodeAt(s+(p=a+2)),w=r.charCodeAt(s+(d=a+3)),m=a+=4,l=0;l<me;l+=2)g=O[l],y=O[l+1],u=e(g,u,c,I,y),c=e(u,c,p,A,y),p=e(c,p,d,C,y),m=e(p,d,m,w,y),O[l]=m,d=p,p=c,c=u,u=g;for(;a<o;)for(I=r.charCodeAt(s+(u=a)),m=++a,l=0;l<me;l+=2)g=O[l],O[l]=m=e(g,u,m,I,O[l+1]),u=g;return m}}()});var Zs=jo(()=>{"use strict"});var Xs=jo(()=>{"use strict"});var va=W((Rx,am)=>{am.exports={name:"@prisma/engines-version",version:"6.11.0-15.f67607f6772d3f263d40c8e233b50714bc8295cc",main:"index.js",types:"index.d.ts",license:"Apache-2.0",author:"Tim Suchanek <suchanek@prisma.io>",prisma:{enginesVersion:"f67607f6772d3f263d40c8e233b50714bc8295cc"},repository:{type:"git",url:"https://github.com/prisma/engines-wrapper.git",directory:"packages/engines-version"},devDependencies:{"@types/node":"18.19.76",typescript:"4.9.5"},files:["index.js","index.d.ts"],scripts:{build:"tsc -d"}}});var eo=W(et=>{"use strict";Object.defineProperty(et,"__esModule",{value:!0});et.anumber=Xi;et.abytes=gl;et.ahash=uf;et.aexists=cf;et.aoutput=pf;function Xi(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function lf(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function gl(e,...t){if(!lf(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function uf(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Xi(e.outputLen),Xi(e.blockLen)}function cf(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function pf(e,t){gl(e);let r=t.outputLen;if(e.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}});var Ll=W(P=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0});P.add5L=P.add5H=P.add4H=P.add4L=P.add3H=P.add3L=P.rotlBL=P.rotlBH=P.rotlSL=P.rotlSH=P.rotr32L=P.rotr32H=P.rotrBL=P.rotrBH=P.rotrSL=P.rotrSH=P.shrSL=P.shrSH=P.toBig=void 0;P.fromBig=ro;P.split=yl;P.add=kl;var Fn=BigInt(2**32-1),to=BigInt(32);function ro(e,t=!1){return t?{h:Number(e&Fn),l:Number(e>>to&Fn)}:{h:Number(e>>to&Fn)|0,l:Number(e&Fn)|0}}function yl(e,t=!1){let r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let i=0;i<e.length;i++){let{h:o,l:s}=ro(e[i],t);[r[i],n[i]]=[o,s]}return[r,n]}var hl=(e,t)=>BigInt(e>>>0)<<to|BigInt(t>>>0);P.toBig=hl;var wl=(e,t,r)=>e>>>r;P.shrSH=wl;var El=(e,t,r)=>e<<32-r|t>>>r;P.shrSL=El;var xl=(e,t,r)=>e>>>r|t<<32-r;P.rotrSH=xl;var bl=(e,t,r)=>e<<32-r|t>>>r;P.rotrSL=bl;var Pl=(e,t,r)=>e<<64-r|t>>>r-32;P.rotrBH=Pl;var vl=(e,t,r)=>e>>>r-32|t<<64-r;P.rotrBL=vl;var Tl=(e,t)=>t;P.rotr32H=Tl;var Al=(e,t)=>e;P.rotr32L=Al;var Cl=(e,t,r)=>e<<r|t>>>32-r;P.rotlSH=Cl;var Sl=(e,t,r)=>t<<r|e>>>32-r;P.rotlSL=Sl;var Rl=(e,t,r)=>t<<r-32|e>>>64-r;P.rotlBH=Rl;var Il=(e,t,r)=>e<<r-32|t>>>64-r;P.rotlBL=Il;function kl(e,t,r,n){let i=(t>>>0)+(n>>>0);return{h:e+r+(i/2**32|0)|0,l:i|0}}var Ol=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0);P.add3L=Ol;var Dl=(e,t,r,n)=>t+r+n+(e/2**32|0)|0;P.add3H=Dl;var _l=(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0);P.add4L=_l;var Nl=(e,t,r,n,i)=>t+r+n+i+(e/2**32|0)|0;P.add4H=Nl;var Ml=(e,t,r,n,i)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(i>>>0);P.add5L=Ml;var Fl=(e,t,r,n,i,o)=>t+r+n+i+o+(e/2**32|0)|0;P.add5H=Fl;var df={fromBig:ro,split:yl,toBig:hl,shrSH:wl,shrSL:El,rotrSH:xl,rotrSL:bl,rotrBH:Pl,rotrBL:vl,rotr32H:Tl,rotr32L:Al,rotlSH:Cl,rotlSL:Sl,rotlBH:Rl,rotlBL:Il,add:kl,add3L:Ol,add3H:Dl,add4L:_l,add4H:Nl,add5H:Fl,add5L:Ml};P.default=df});var $l=W(Ln=>{"use strict";Object.defineProperty(Ln,"__esModule",{value:!0});Ln.crypto=void 0;var Qe=require("node:crypto");Ln.crypto=Qe&&typeof Qe=="object"&&"webcrypto"in Qe?Qe.webcrypto:Qe&&typeof Qe=="object"&&"randomBytes"in Qe?Qe:void 0});var Ul=W(R=>{"use strict";Object.defineProperty(R,"__esModule",{value:!0});R.Hash=R.nextTick=R.byteSwapIfBE=R.isLE=void 0;R.isBytes=mf;R.u8=ff;R.u32=gf;R.createView=yf;R.rotr=hf;R.rotl=wf;R.byteSwap=oo;R.byteSwap32=Ef;R.bytesToHex=bf;R.hexToBytes=Pf;R.asyncLoop=Tf;R.utf8ToBytes=ql;R.toBytes=$n;R.concatBytes=Af;R.checkOpts=Cf;R.wrapConstructor=Sf;R.wrapConstructorWithOpts=Rf;R.wrapXOFConstructorWithOpts=If;R.randomBytes=kf;var kt=$l(),io=eo();function mf(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function ff(e){return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}function gf(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function yf(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function hf(e,t){return e<<32-t|e>>>t}function wf(e,t){return e<<t|e>>>32-t>>>0}R.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function oo(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}R.byteSwapIfBE=R.isLE?e=>e:e=>oo(e);function Ef(e){for(let t=0;t<e.length;t++)e[t]=oo(e[t])}var xf=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function bf(e){(0,io.abytes)(e);let t="";for(let r=0;r<e.length;r++)t+=xf[e[r]];return t}var _e={_0:48,_9:57,A:65,F:70,a:97,f:102};function Vl(e){if(e>=_e._0&&e<=_e._9)return e-_e._0;if(e>=_e.A&&e<=_e.F)return e-(_e.A-10);if(e>=_e.a&&e<=_e.f)return e-(_e.a-10)}function Pf(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);let t=e.length,r=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);let n=new Uint8Array(r);for(let i=0,o=0;i<r;i++,o+=2){let s=Vl(e.charCodeAt(o)),a=Vl(e.charCodeAt(o+1));if(s===void 0||a===void 0){let l=e[o]+e[o+1];throw new Error('hex string expected, got non-hex character "'+l+'" at index '+o)}n[i]=s*16+a}return n}var vf=async()=>{};R.nextTick=vf;async function Tf(e,t,r){let n=Date.now();for(let i=0;i<e;i++){r(i);let o=Date.now()-n;o>=0&&o<t||(await(0,R.nextTick)(),n+=o)}}function ql(e){if(typeof e!="string")throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array(new TextEncoder().encode(e))}function $n(e){return typeof e=="string"&&(e=ql(e)),(0,io.abytes)(e),e}function Af(...e){let t=0;for(let n=0;n<e.length;n++){let i=e[n];(0,io.abytes)(i),t+=i.length}let r=new Uint8Array(t);for(let n=0,i=0;n<e.length;n++){let o=e[n];r.set(o,i),i+=o.length}return r}var no=class{clone(){return this._cloneInto()}};R.Hash=no;function Cf(e,t){if(t!==void 0&&{}.toString.call(t)!=="[object Object]")throw new Error("Options should be object or undefined");return Object.assign(e,t)}function Sf(e){let t=n=>e().update($n(n)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function Rf(e){let t=(n,i)=>e(i).update($n(n)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=n=>e(n),t}function If(e){let t=(n,i)=>e(i).update($n(n)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=n=>e(n),t}function kf(e=32){if(kt.crypto&&typeof kt.crypto.getRandomValues=="function")return kt.crypto.getRandomValues(new Uint8Array(e));if(kt.crypto&&typeof kt.crypto.randomBytes=="function")return kt.crypto.randomBytes(e);throw new Error("crypto.getRandomValues must be defined")}});var Kl=W($=>{"use strict";Object.defineProperty($,"__esModule",{value:!0});$.shake256=$.shake128=$.keccak_512=$.keccak_384=$.keccak_256=$.keccak_224=$.sha3_512=$.sha3_384=$.sha3_256=$.sha3_224=$.Keccak=void 0;$.keccakP=Wl;var Ot=eo(),Pr=Ll(),Ne=Ul(),Ql=[],Hl=[],Gl=[],Of=BigInt(0),br=BigInt(1),Df=BigInt(2),_f=BigInt(7),Nf=BigInt(256),Mf=BigInt(113);for(let e=0,t=br,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],Ql.push(2*(5*n+r)),Hl.push((e+1)*(e+2)/2%64);let i=Of;for(let o=0;o<7;o++)t=(t<<br^(t>>_f)*Mf)%Nf,t&Df&&(i^=br<<(br<<BigInt(o))-br);Gl.push(i)}var[Ff,Lf]=(0,Pr.split)(Gl,!0),jl=(e,t,r)=>r>32?(0,Pr.rotlBH)(e,t,r):(0,Pr.rotlSH)(e,t,r),Bl=(e,t,r)=>r>32?(0,Pr.rotlBL)(e,t,r):(0,Pr.rotlSL)(e,t,r);function Wl(e,t=24){let r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let s=0;s<10;s++)r[s]=e[s]^e[s+10]^e[s+20]^e[s+30]^e[s+40];for(let s=0;s<10;s+=2){let a=(s+8)%10,l=(s+2)%10,u=r[l],c=r[l+1],p=jl(u,c,1)^r[a],d=Bl(u,c,1)^r[a+1];for(let m=0;m<50;m+=10)e[s+m]^=p,e[s+m+1]^=d}let i=e[2],o=e[3];for(let s=0;s<24;s++){let a=Hl[s],l=jl(i,o,a),u=Bl(i,o,a),c=Ql[s];i=e[c],o=e[c+1],e[c]=l,e[c+1]=u}for(let s=0;s<50;s+=10){for(let a=0;a<10;a++)r[a]=e[s+a];for(let a=0;a<10;a++)e[s+a]^=~r[(a+2)%10]&r[(a+4)%10]}e[0]^=Ff[n],e[1]^=Lf[n]}r.fill(0)}var vr=class e extends Ne.Hash{constructor(t,r,n,i=!1,o=24){if(super(),this.blockLen=t,this.suffix=r,this.outputLen=n,this.enableXOF=i,this.rounds=o,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,(0,Ot.anumber)(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,Ne.u32)(this.state)}keccak(){Ne.isLE||(0,Ne.byteSwap32)(this.state32),Wl(this.state32,this.rounds),Ne.isLE||(0,Ne.byteSwap32)(this.state32),this.posOut=0,this.pos=0}update(t){(0,Ot.aexists)(this);let{blockLen:r,state:n}=this;t=(0,Ne.toBytes)(t);let i=t.length;for(let o=0;o<i;){let s=Math.min(r-this.pos,i-o);for(let a=0;a<s;a++)n[this.pos++]^=t[o++];this.pos===r&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:t,suffix:r,pos:n,blockLen:i}=this;t[n]^=r,(r&128)!==0&&n===i-1&&this.keccak(),t[i-1]^=128,this.keccak()}writeInto(t){(0,Ot.aexists)(this,!1),(0,Ot.abytes)(t),this.finish();let r=this.state,{blockLen:n}=this;for(let i=0,o=t.length;i<o;){this.posOut>=n&&this.keccak();let s=Math.min(n-this.posOut,o-i);t.set(r.subarray(this.posOut,this.posOut+s),i),this.posOut+=s,i+=s}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return(0,Ot.anumber)(t),this.xofInto(new Uint8Array(t))}digestInto(t){if((0,Ot.aoutput)(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){let{blockLen:r,suffix:n,outputLen:i,rounds:o,enableXOF:s}=this;return t||(t=new e(r,n,i,s,o)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=o,t.suffix=n,t.outputLen=i,t.enableXOF=s,t.destroyed=this.destroyed,t}};$.Keccak=vr;var He=(e,t,r)=>(0,Ne.wrapConstructor)(()=>new vr(t,e,r));$.sha3_224=He(6,144,224/8);$.sha3_256=He(6,136,256/8);$.sha3_384=He(6,104,384/8);$.sha3_512=He(6,72,512/8);$.keccak_224=He(1,144,224/8);$.keccak_256=He(1,136,256/8);$.keccak_384=He(1,104,384/8);$.keccak_512=He(1,72,512/8);var Jl=(e,t,r)=>(0,Ne.wrapXOFConstructorWithOpts)((n={})=>new vr(t,e,n.dkLen===void 0?r:n.dkLen,!0));$.shake128=Jl(31,168,128/8);$.shake256=Jl(31,136,256/8)});var nu=W((oP,Ge)=>{"use strict";var{sha3_512:$f}=Kl(),Yl=24,Tr=32,so=(e=4,t=Math.random)=>{let r="";for(;r.length<e;)r=r+Math.floor(t()*36).toString(36);return r};function Zl(e){let t=8n,r=0n;for(let n of e.values()){let i=BigInt(n);r=(r<<t)+i}return r}var Xl=(e="")=>Zl($f(e)).toString(36).slice(1),zl=Array.from({length:26},(e,t)=>String.fromCharCode(t+97)),Vf=e=>zl[Math.floor(e()*zl.length)],eu=({globalObj:e=typeof global<"u"?global:typeof window<"u"?window:{},random:t=Math.random}={})=>{let r=Object.keys(e).toString(),n=r.length?r+so(Tr,t):so(Tr,t);return Xl(n).substring(0,Tr)},tu=e=>()=>e++,qf=476782367,ru=({random:e=Math.random,counter:t=tu(Math.floor(e()*qf)),length:r=Yl,fingerprint:n=eu({random:e})}={})=>function(){let o=Vf(e),s=Date.now().toString(36),a=t().toString(36),l=so(r,e),u=`${s+l+a+n}`;return`${o+Xl(u).substring(1,r)}`},Uf=ru(),jf=(e,{minLength:t=2,maxLength:r=Tr}={})=>{let n=e.length,i=/^[0-9a-z]+$/;try{if(typeof e=="string"&&n>=t&&n<=r&&i.test(e))return!0}finally{}return!1};Ge.exports.getConstants=()=>({defaultLength:Yl,bigLength:Tr});Ge.exports.init=ru;Ge.exports.createId=Uf;Ge.exports.bufToBigInt=Zl;Ge.exports.createCounter=tu;Ge.exports.createFingerprint=eu;Ge.exports.isCuid=jf});var iu=W((sP,Ar)=>{"use strict";var{createId:Bf,init:Qf,getConstants:Hf,isCuid:Gf}=nu();Ar.exports.createId=Bf;Ar.exports.init=Qf;Ar.exports.getConstants=Hf;Ar.exports.isCuid=Gf});var Wg={};ct(Wg,{DMMF:()=>rr,Debug:()=>q,Decimal:()=>K,Extensions:()=>si,MetricsClient:()=>Ct,PrismaClientInitializationError:()=>k,PrismaClientKnownRequestError:()=>Q,PrismaClientRustPanicError:()=>ne,PrismaClientUnknownRequestError:()=>X,PrismaClientValidationError:()=>ee,Public:()=>ai,Sql:()=>le,createParam:()=>ga,defineDmmfProperty:()=>ba,deserializeJsonResponse:()=>qe,deserializeRawResult:()=>ri,dmmfToRuntimeDataModel:()=>Us,empty:()=>Aa,getPrismaClient:()=>gc,getRuntime:()=>_n,join:()=>Ta,makeStrictEnum:()=>yc,makeTypedQueryFactory:()=>Pa,objectEnumValues:()=>wn,raw:()=>Li,serializeJsonQuery:()=>An,skip:()=>Tn,sqltag:()=>$i,warnEnvConflicts:()=>hc,warnOnce:()=>Xt});module.exports=vc(Wg);var si={};ct(si,{defineExtension:()=>Qo,getExtensionContext:()=>Ho});function Qo(e){return typeof e=="function"?e:t=>t.$extends(e)}function Ho(e){return e}var ai={};ct(ai,{validator:()=>Go});function Go(...e){return t=>t}var Jr={};ct(Jr,{$:()=>Yo,bgBlack:()=>_c,bgBlue:()=>Lc,bgCyan:()=>Vc,bgGreen:()=>Mc,bgMagenta:()=>$c,bgRed:()=>Nc,bgWhite:()=>qc,bgYellow:()=>Fc,black:()=>Ic,blue:()=>ze,bold:()=>re,cyan:()=>Ie,dim:()=>Je,gray:()=>Ht,green:()=>Qt,grey:()=>Dc,hidden:()=>Sc,inverse:()=>Cc,italic:()=>Ac,magenta:()=>kc,red:()=>Re,reset:()=>Tc,strikethrough:()=>Rc,underline:()=>se,white:()=>Oc,yellow:()=>Ke});var li,Wo,Jo,Ko,zo=!0;typeof process<"u"&&({FORCE_COLOR:li,NODE_DISABLE_COLORS:Wo,NO_COLOR:Jo,TERM:Ko}=process.env||{},zo=process.stdout&&process.stdout.isTTY);var Yo={enabled:!Wo&&Jo==null&&Ko!=="dumb"&&(li!=null&&li!=="0"||zo)};function M(e,t){let r=new RegExp(`\\x1b\\[${t}m`,"g"),n=`\x1B[${e}m`,i=`\x1B[${t}m`;return function(o){return!Yo.enabled||o==null?o:n+(~(""+o).indexOf(i)?o.replace(r,i+n):o)+i}}var Tc=M(0,0),re=M(1,22),Je=M(2,22),Ac=M(3,23),se=M(4,24),Cc=M(7,27),Sc=M(8,28),Rc=M(9,29),Ic=M(30,39),Re=M(31,39),Qt=M(32,39),Ke=M(33,39),ze=M(34,39),kc=M(35,39),Ie=M(36,39),Oc=M(37,39),Ht=M(90,39),Dc=M(90,39),_c=M(40,49),Nc=M(41,49),Mc=M(42,49),Fc=M(43,49),Lc=M(44,49),$c=M(45,49),Vc=M(46,49),qc=M(47,49);var Uc=100,Zo=["green","yellow","blue","magenta","cyan","red"],Gt=[],Xo=Date.now(),jc=0,ui=typeof process<"u"?process.env:{};globalThis.DEBUG??=ui.DEBUG??"";globalThis.DEBUG_COLORS??=ui.DEBUG_COLORS?ui.DEBUG_COLORS==="true":!0;var Wt={enable(e){typeof e=="string"&&(globalThis.DEBUG=e)},disable(){let e=globalThis.DEBUG;return globalThis.DEBUG="",e},enabled(e){let t=globalThis.DEBUG.split(",").map(i=>i.replace(/[.+?^${}()|[\]\\]/g,"\\$&")),r=t.some(i=>i===""||i[0]==="-"?!1:e.match(RegExp(i.split("*").join(".*")+"$"))),n=t.some(i=>i===""||i[0]!=="-"?!1:e.match(RegExp(i.slice(1).split("*").join(".*")+"$")));return r&&!n},log:(...e)=>{let[t,r,...n]=e;(console.warn??console.log)(`${t} ${r}`,...n)},formatters:{}};function Bc(e){let t={color:Zo[jc++%Zo.length],enabled:Wt.enabled(e),namespace:e,log:Wt.log,extend:()=>{}},r=(...n)=>{let{enabled:i,namespace:o,color:s,log:a}=t;if(n.length!==0&&Gt.push([o,...n]),Gt.length>Uc&&Gt.shift(),Wt.enabled(o)||i){let l=n.map(c=>typeof c=="string"?c:Qc(c)),u=`+${Date.now()-Xo}ms`;Xo=Date.now(),globalThis.DEBUG_COLORS?a(Jr[s](re(o)),...l,Jr[s](u)):a(o,...l,u)}};return new Proxy(r,{get:(n,i)=>t[i],set:(n,i,o)=>t[i]=o})}var q=new Proxy(Bc,{get:(e,t)=>Wt[t],set:(e,t,r)=>Wt[t]=r});function Qc(e,t=2){let r=new Set;return JSON.stringify(e,(n,i)=>{if(typeof i=="object"&&i!==null){if(r.has(i))return"[Circular *]";r.add(i)}else if(typeof i=="bigint")return i.toString();return i},t)}function es(e=7500){let t=Gt.map(([r,...n])=>`${r} ${n.map(i=>typeof i=="string"?i:JSON.stringify(i)).join(" ")}`).join(`
4
- `);return t.length<e?t:t.slice(-e)}function ts(){Gt.length=0}var rs=q;var Gc=ns(),ci=Gc.version;function pt(e){let t=Wc();return t||(e?.config.engineType==="library"?"library":e?.config.engineType==="binary"?"binary":e?.config.engineType==="client"?"client":Jc(e))}function Wc(){let e=process.env.PRISMA_CLIENT_ENGINE_TYPE;return e==="library"?"library":e==="binary"?"binary":e==="client"?"client":void 0}function Jc(e){return e?.previewFeatures.includes("queryCompiler")?"client":"library"}var ss=j(os(),1);function pi(e){let t=(0,ss.default)(e);if(t===0)return e;let r=new RegExp(`^[ \\t]{${t}}`,"gm");return e.replace(r,"")}var as="prisma+postgres",Kr=`${as}:`;function zr(e){return e?.toString().startsWith(`${Kr}//`)??!1}function di(e){if(!zr(e))return!1;let{host:t}=new URL(e);return t.includes("localhost")||t.includes("127.0.0.1")}var Kt={};ct(Kt,{error:()=>Yc,info:()=>zc,log:()=>Kc,query:()=>Zc,should:()=>cs,tags:()=>Jt,warn:()=>mi});var Jt={error:Re("prisma:error"),warn:Ke("prisma:warn"),info:Ie("prisma:info"),query:ze("prisma:query")},cs={warn:()=>!process.env.PRISMA_DISABLE_WARNINGS};function Kc(...e){console.log(...e)}function mi(e,...t){cs.warn()&&console.warn(`${Jt.warn} ${e}`,...t)}function zc(e,...t){console.info(`${Jt.info} ${e}`,...t)}function Yc(e,...t){console.error(`${Jt.error} ${e}`,...t)}function Zc(e,...t){console.log(`${Jt.query} ${e}`,...t)}function fe(e,t){throw new Error(t)}var zt=j(require("node:path"));function gi(e){return zt.default.sep===zt.default.posix.sep?e:e.split(zt.default.sep).join(zt.default.posix.sep)}var Ei=j(Es()),Yr=j(require("node:fs"));var dt=j(require("node:path"));function xs(e){let t=e.ignoreProcessEnv?{}:process.env,r=n=>n.match(/(.?\${(?:[a-zA-Z0-9_]+)?})/g)?.reduce(function(o,s){let a=/(.?)\${([a-zA-Z0-9_]+)?}/g.exec(s);if(!a)return o;let l=a[1],u,c;if(l==="\\")c=a[0],u=c.replace("\\$","$");else{let p=a[2];c=a[0].substring(l.length),u=Object.hasOwnProperty.call(t,p)?t[p]:e.parsed[p]||"",u=r(u)}return o.replace(c,u)},n)??n;for(let n in e.parsed){let i=Object.hasOwnProperty.call(t,n)?t[n]:e.parsed[n];e.parsed[n]=r(i)}for(let n in e.parsed)t[n]=e.parsed[n];return e}var wi=rs("prisma:tryLoadEnv");function Zt({rootEnvPath:e,schemaEnvPath:t},r={conflictCheck:"none"}){let n=bs(e);r.conflictCheck!=="none"&&fp(n,t,r.conflictCheck);let i=null;return Ps(n?.path,t)||(i=bs(t)),!n&&!i&&wi("No Environment variables loaded"),i?.dotenvResult.error?console.error(Re(re("Schema Env Error: "))+i.dotenvResult.error):{message:[n?.message,i?.message].filter(Boolean).join(`
5
- `),parsed:{...n?.dotenvResult?.parsed,...i?.dotenvResult?.parsed}}}function fp(e,t,r){let n=e?.dotenvResult.parsed,i=!Ps(e?.path,t);if(n&&t&&i&&Yr.default.existsSync(t)){let o=Ei.default.parse(Yr.default.readFileSync(t)),s=[];for(let a in o)n[a]===o[a]&&s.push(a);if(s.length>0){let a=dt.default.relative(process.cwd(),e.path),l=dt.default.relative(process.cwd(),t);if(r==="error"){let u=`There is a conflict between env var${s.length>1?"s":""} in ${se(a)} and ${se(l)}
1
+ "use strict";var yc=Object.create;var Wr=Object.defineProperty;var wc=Object.getOwnPropertyDescriptor;var Ec=Object.getOwnPropertyNames;var xc=Object.getPrototypeOf,bc=Object.prototype.hasOwnProperty;var jo=(e,t)=>()=>(e&&(t=e(e=0)),t);var W=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),ct=(e,t)=>{for(var r in t)Wr(e,r,{get:t[r],enumerable:!0})},Bo=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Ec(t))!bc.call(e,i)&&i!==r&&Wr(e,i,{get:()=>t[i],enumerable:!(n=wc(t,i))||n.enumerable});return e};var j=(e,t,r)=>(r=e!=null?yc(xc(e)):{},Bo(t||!e||!e.__esModule?Wr(r,"default",{value:e,enumerable:!0}):r,e)),Pc=e=>Bo(Wr({},"__esModule",{value:!0}),e);var ns=W((ih,Qc)=>{Qc.exports={name:"@prisma/internals",version:"6.11.0-dev.3",description:"This package is intended for Prisma's internal use",main:"dist/index.js",types:"dist/index.d.ts",repository:{type:"git",url:"https://github.com/prisma/prisma.git",directory:"packages/internals"},homepage:"https://www.prisma.io",author:"Tim Suchanek <suchanek@prisma.io>",bugs:"https://github.com/prisma/prisma/issues",license:"Apache-2.0",scripts:{dev:"DEV=true tsx helpers/build.ts",build:"tsx helpers/build.ts",test:"dotenv -e ../../.db.env -- jest --silent",prepublishOnly:"pnpm run build"},files:["README.md","dist","!**/libquery_engine*","!dist/get-generators/engines/*","scripts"],devDependencies:{"@babel/helper-validator-identifier":"7.25.9","@opentelemetry/api":"1.9.0","@swc/core":"1.11.5","@swc/jest":"0.2.37","@types/babel__helper-validator-identifier":"7.15.2","@types/jest":"29.5.14","@types/node":"18.19.76","@types/resolve":"1.20.6",archiver:"6.0.2","checkpoint-client":"1.1.33","cli-truncate":"4.0.0",dotenv:"16.5.0",esbuild:"0.25.1","escape-string-regexp":"5.0.0",execa:"5.1.1","fast-glob":"3.3.3","find-up":"7.0.0","fp-ts":"2.16.9","fs-extra":"11.3.0","fs-jetpack":"5.1.0","global-dirs":"4.0.0",globby:"11.1.0","identifier-regex":"1.0.0","indent-string":"4.0.0","is-windows":"1.0.2","is-wsl":"3.1.0",jest:"29.7.0","jest-junit":"16.0.0",kleur:"4.1.5","mock-stdin":"1.0.0","new-github-issue-url":"0.2.1","node-fetch":"3.3.2","npm-packlist":"5.1.3",open:"7.4.2","p-map":"4.0.0","read-package-up":"11.0.0",resolve:"1.22.10","string-width":"7.2.0","strip-ansi":"6.0.1","strip-indent":"4.0.0","temp-dir":"2.0.0",tempy:"1.0.1","terminal-link":"4.0.0",tmp:"0.2.3","ts-node":"10.9.2","ts-pattern":"5.6.2","ts-toolbelt":"9.6.0",typescript:"5.4.5",yarn:"1.22.22"},dependencies:{"@prisma/config":"workspace:*","@prisma/debug":"workspace:*","@prisma/dmmf":"workspace:*","@prisma/driver-adapter-utils":"workspace:*","@prisma/engines":"workspace:*","@prisma/fetch-engine":"workspace:*","@prisma/generator":"workspace:*","@prisma/generator-helper":"workspace:*","@prisma/get-platform":"workspace:*","@prisma/prisma-schema-wasm":"6.11.0-1.09706cd7c13a662843f8f7f16e6128aedbee4654","@prisma/schema-engine-wasm":"6.11.0-1.09706cd7c13a662843f8f7f16e6128aedbee4654","@prisma/schema-files-loader":"workspace:*",arg:"5.0.2",prompts:"2.4.2"},peerDependencies:{typescript:">=5.1.0"},peerDependenciesMeta:{typescript:{optional:!0}},sideEffects:!1}});var os=W((ah,is)=>{"use strict";is.exports=e=>{let t=e.match(/^[ \t]*(?=\S)/gm);return t?t.reduce((r,n)=>Math.min(r,n.length),1/0):0}});var us=W((ch,ls)=>{"use strict";ls.exports=(e,t=1,r)=>{if(r={indent:" ",includeEmptyLines:!1,...r},typeof e!="string")throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof e}\``);if(typeof t!="number")throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof t}\``);if(typeof r.indent!="string")throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof r.indent}\``);if(t===0)return e;let n=r.includeEmptyLines?/^/gm:/^(?!\s*$)/gm;return e.replace(n,r.indent.repeat(t))}});var ds=W((dh,ps)=>{"use strict";ps.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 fi=W((mh,ms)=>{"use strict";var Zc=ds();ms.exports=e=>typeof e=="string"?e.replace(Zc(),""):e});var fs=W((hh,Xc)=>{Xc.exports={name:"dotenv",version:"16.5.0",description:"Loads environment variables from .env file",main:"lib/main.js",types:"lib/main.d.ts",exports:{".":{types:"./lib/main.d.ts",require:"./lib/main.js",default:"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},scripts:{"dts-check":"tsc --project tests/types/tsconfig.json",lint:"standard",pretest:"npm run lint && npm run dts-check",test:"tap run --allow-empty-coverage --disable-coverage --timeout=60000","test:coverage":"tap run --show-full-coverage --timeout=60000 --coverage-report=lcov",prerelease:"npm test",release:"standard-version"},repository:{type:"git",url:"git://github.com/motdotla/dotenv.git"},homepage:"https://github.com/motdotla/dotenv#readme",funding:"https://dotenvx.com",keywords:["dotenv","env",".env","environment","variables","config","settings"],readmeFilename:"README.md",license:"BSD-2-Clause",devDependencies:{"@types/node":"^18.11.3",decache:"^4.6.2",sinon:"^14.0.1",standard:"^17.0.0","standard-version":"^9.5.0",tap:"^19.2.0",typescript:"^4.8.4"},engines:{node:">=12"},browser:{fs:!1}}});var Es=W((yh,ke)=>{"use strict";var hi=require("node:fs"),yi=require("node:path"),ep=require("node:os"),tp=require("node:crypto"),rp=fs(),hs=rp.version,np=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function ip(e){let t={},r=e.toString();r=r.replace(/\r\n?/mg,`
2
+ `);let n;for(;(n=np.exec(r))!=null;){let i=n[1],o=n[2]||"";o=o.trim();let s=o[0];o=o.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),s==='"'&&(o=o.replace(/\\n/g,`
3
+ `),o=o.replace(/\\r/g,"\r")),t[i]=o}return t}function op(e){let t=ws(e),r=B.configDotenv({path:t});if(!r.parsed){let s=new Error(`MISSING_DATA: Cannot parse ${t} for an unknown reason`);throw s.code="MISSING_DATA",s}let n=ys(e).split(","),i=n.length,o;for(let s=0;s<i;s++)try{let a=n[s].trim(),l=ap(r,a);o=B.decrypt(l.ciphertext,l.key);break}catch(a){if(s+1>=i)throw a}return B.parse(o)}function sp(e){console.log(`[dotenv@${hs}][WARN] ${e}`)}function Yt(e){console.log(`[dotenv@${hs}][DEBUG] ${e}`)}function ys(e){return e&&e.DOTENV_KEY&&e.DOTENV_KEY.length>0?e.DOTENV_KEY:process.env.DOTENV_KEY&&process.env.DOTENV_KEY.length>0?process.env.DOTENV_KEY:""}function ap(e,t){let r;try{r=new URL(t)}catch(a){if(a.code==="ERR_INVALID_URL"){let l=new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");throw l.code="INVALID_DOTENV_KEY",l}throw a}let n=r.password;if(!n){let a=new Error("INVALID_DOTENV_KEY: Missing key part");throw a.code="INVALID_DOTENV_KEY",a}let i=r.searchParams.get("environment");if(!i){let a=new Error("INVALID_DOTENV_KEY: Missing environment part");throw a.code="INVALID_DOTENV_KEY",a}let o=`DOTENV_VAULT_${i.toUpperCase()}`,s=e.parsed[o];if(!s){let a=new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${o} in your .env.vault file.`);throw a.code="NOT_FOUND_DOTENV_ENVIRONMENT",a}return{ciphertext:s,key:n}}function ws(e){let t=null;if(e&&e.path&&e.path.length>0)if(Array.isArray(e.path))for(let r of e.path)hi.existsSync(r)&&(t=r.endsWith(".vault")?r:`${r}.vault`);else t=e.path.endsWith(".vault")?e.path:`${e.path}.vault`;else t=yi.resolve(process.cwd(),".env.vault");return hi.existsSync(t)?t:null}function gs(e){return e[0]==="~"?yi.join(ep.homedir(),e.slice(1)):e}function lp(e){!!(e&&e.debug)&&Yt("Loading env from encrypted .env.vault");let r=B._parseVault(e),n=process.env;return e&&e.processEnv!=null&&(n=e.processEnv),B.populate(n,r,e),{parsed:r}}function up(e){let t=yi.resolve(process.cwd(),".env"),r="utf8",n=!!(e&&e.debug);e&&e.encoding?r=e.encoding:n&&Yt("No encoding is specified. UTF-8 is used by default");let i=[t];if(e&&e.path)if(!Array.isArray(e.path))i=[gs(e.path)];else{i=[];for(let l of e.path)i.push(gs(l))}let o,s={};for(let l of i)try{let u=B.parse(hi.readFileSync(l,{encoding:r}));B.populate(s,u,e)}catch(u){n&&Yt(`Failed to load ${l} ${u.message}`),o=u}let a=process.env;return e&&e.processEnv!=null&&(a=e.processEnv),B.populate(a,s,e),o?{parsed:s,error:o}:{parsed:s}}function cp(e){if(ys(e).length===0)return B.configDotenv(e);let t=ws(e);return t?B._configVault(e):(sp(`You set DOTENV_KEY but you are missing a .env.vault file at ${t}. Did you forget to build it?`),B.configDotenv(e))}function pp(e,t){let r=Buffer.from(t.slice(-64),"hex"),n=Buffer.from(e,"base64"),i=n.subarray(0,12),o=n.subarray(-16);n=n.subarray(12,-16);try{let s=tp.createDecipheriv("aes-256-gcm",r,i);return s.setAuthTag(o),`${s.update(n)}${s.final()}`}catch(s){let a=s instanceof RangeError,l=s.message==="Invalid key length",u=s.message==="Unsupported state or unable to authenticate data";if(a||l){let c=new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");throw c.code="INVALID_DOTENV_KEY",c}else if(u){let c=new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");throw c.code="DECRYPTION_FAILED",c}else throw s}}function dp(e,t,r={}){let n=!!(r&&r.debug),i=!!(r&&r.override);if(typeof t!="object"){let o=new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");throw o.code="OBJECT_REQUIRED",o}for(let o of Object.keys(t))Object.prototype.hasOwnProperty.call(e,o)?(i===!0&&(e[o]=t[o]),n&&Yt(i===!0?`"${o}" is already defined and WAS overwritten`:`"${o}" is already defined and was NOT overwritten`)):e[o]=t[o]}var B={configDotenv:up,_configVault:lp,_parseVault:op,config:cp,decrypt:pp,parse:ip,populate:dp};ke.exports.configDotenv=B.configDotenv;ke.exports._configVault=B._configVault;ke.exports._parseVault=B._parseVault;ke.exports.config=B.config;ke.exports.decrypt=B.decrypt;ke.exports.parse=B.parse;ke.exports.populate=B.populate;ke.exports=B});var vs=W((vh,Zr)=>{"use strict";Zr.exports=(e={})=>{let t;if(e.repoUrl)t=e.repoUrl;else if(e.user&&e.repo)t=`https://github.com/${e.user}/${e.repo}`;else throw new Error("You need to specify either the `repoUrl` option or both the `user` and `repo` options");let r=new URL(`${t}/issues/new`),n=["body","title","labels","template","milestone","assignee","projects"];for(let i of n){let o=e[i];if(o!==void 0){if(i==="labels"||i==="projects"){if(!Array.isArray(o))throw new TypeError(`The \`${i}\` option should be an array`);o=o.join(",")}r.searchParams.set(i,o)}}return r.toString()};Zr.exports.default=Zr.exports});var Ri=W((Zy,Ws)=>{"use strict";Ws.exports=function(){function e(t,r,n,i,o){return t<r||n<r?t>n?n+1:t+1:i===o?r:r+1}return function(t,r){if(t===r)return 0;if(t.length>r.length){var n=t;t=r,r=n}for(var i=t.length,o=r.length;i>0&&t.charCodeAt(i-1)===r.charCodeAt(o-1);)i--,o--;for(var s=0;s<i&&t.charCodeAt(s)===r.charCodeAt(s);)s++;if(i-=s,o-=s,i===0||o<3)return o;var a=0,l,u,c,p,d,f,g,h,I,T,C,w,O=[];for(l=0;l<i;l++)O.push(l+1),O.push(t.charCodeAt(s+l));for(var me=O.length-1;a<o-3;)for(I=r.charCodeAt(s+(u=a)),T=r.charCodeAt(s+(c=a+1)),C=r.charCodeAt(s+(p=a+2)),w=r.charCodeAt(s+(d=a+3)),f=a+=4,l=0;l<me;l+=2)g=O[l],h=O[l+1],u=e(g,u,c,I,h),c=e(u,c,p,T,h),p=e(c,p,d,C,h),f=e(p,d,f,w,h),O[l]=f,d=p,p=c,c=u,u=g;for(;a<o;)for(I=r.charCodeAt(s+(u=a)),f=++a,l=0;l<me;l+=2)g=O[l],O[l]=f=e(g,u,f,I,O[l+1]),u=g;return f}}()});var Zs=jo(()=>{"use strict"});var Xs=jo(()=>{"use strict"});var va=W((Sx,sm)=>{sm.exports={name:"@prisma/engines-version",version:"6.11.0-1.09706cd7c13a662843f8f7f16e6128aedbee4654",main:"index.js",types:"index.d.ts",license:"Apache-2.0",author:"Tim Suchanek <suchanek@prisma.io>",prisma:{enginesVersion:"09706cd7c13a662843f8f7f16e6128aedbee4654"},repository:{type:"git",url:"https://github.com/prisma/engines-wrapper.git",directory:"packages/engines-version"},devDependencies:{"@types/node":"18.19.76",typescript:"4.9.5"},files:["index.js","index.d.ts"],scripts:{build:"tsc -d"}}});var eo=W(et=>{"use strict";Object.defineProperty(et,"__esModule",{value:!0});et.anumber=Xi;et.abytes=gl;et.ahash=lf;et.aexists=uf;et.aoutput=cf;function Xi(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function af(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function gl(e,...t){if(!af(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function lf(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Xi(e.outputLen),Xi(e.blockLen)}function uf(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function cf(e,t){gl(e);let r=t.outputLen;if(e.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}});var Ll=W(P=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0});P.add5L=P.add5H=P.add4H=P.add4L=P.add3H=P.add3L=P.rotlBL=P.rotlBH=P.rotlSL=P.rotlSH=P.rotr32L=P.rotr32H=P.rotrBL=P.rotrBH=P.rotrSL=P.rotrSH=P.shrSL=P.shrSH=P.toBig=void 0;P.fromBig=ro;P.split=hl;P.add=kl;var Fn=BigInt(2**32-1),to=BigInt(32);function ro(e,t=!1){return t?{h:Number(e&Fn),l:Number(e>>to&Fn)}:{h:Number(e>>to&Fn)|0,l:Number(e&Fn)|0}}function hl(e,t=!1){let r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let i=0;i<e.length;i++){let{h:o,l:s}=ro(e[i],t);[r[i],n[i]]=[o,s]}return[r,n]}var yl=(e,t)=>BigInt(e>>>0)<<to|BigInt(t>>>0);P.toBig=yl;var wl=(e,t,r)=>e>>>r;P.shrSH=wl;var El=(e,t,r)=>e<<32-r|t>>>r;P.shrSL=El;var xl=(e,t,r)=>e>>>r|t<<32-r;P.rotrSH=xl;var bl=(e,t,r)=>e<<32-r|t>>>r;P.rotrSL=bl;var Pl=(e,t,r)=>e<<64-r|t>>>r-32;P.rotrBH=Pl;var vl=(e,t,r)=>e>>>r-32|t<<64-r;P.rotrBL=vl;var Tl=(e,t)=>t;P.rotr32H=Tl;var Al=(e,t)=>e;P.rotr32L=Al;var Cl=(e,t,r)=>e<<r|t>>>32-r;P.rotlSH=Cl;var Sl=(e,t,r)=>t<<r|e>>>32-r;P.rotlSL=Sl;var Rl=(e,t,r)=>t<<r-32|e>>>64-r;P.rotlBH=Rl;var Il=(e,t,r)=>e<<r-32|t>>>64-r;P.rotlBL=Il;function kl(e,t,r,n){let i=(t>>>0)+(n>>>0);return{h:e+r+(i/2**32|0)|0,l:i|0}}var Ol=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0);P.add3L=Ol;var Dl=(e,t,r,n)=>t+r+n+(e/2**32|0)|0;P.add3H=Dl;var _l=(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0);P.add4L=_l;var Nl=(e,t,r,n,i)=>t+r+n+i+(e/2**32|0)|0;P.add4H=Nl;var Ml=(e,t,r,n,i)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(i>>>0);P.add5L=Ml;var Fl=(e,t,r,n,i,o)=>t+r+n+i+o+(e/2**32|0)|0;P.add5H=Fl;var pf={fromBig:ro,split:hl,toBig:yl,shrSH:wl,shrSL:El,rotrSH:xl,rotrSL:bl,rotrBH:Pl,rotrBL:vl,rotr32H:Tl,rotr32L:Al,rotlSH:Cl,rotlSL:Sl,rotlBH:Rl,rotlBL:Il,add:kl,add3L:Ol,add3H:Dl,add4L:_l,add4H:Nl,add5H:Fl,add5L:Ml};P.default=pf});var $l=W(Ln=>{"use strict";Object.defineProperty(Ln,"__esModule",{value:!0});Ln.crypto=void 0;var Qe=require("node:crypto");Ln.crypto=Qe&&typeof Qe=="object"&&"webcrypto"in Qe?Qe.webcrypto:Qe&&typeof Qe=="object"&&"randomBytes"in Qe?Qe:void 0});var Ul=W(R=>{"use strict";Object.defineProperty(R,"__esModule",{value:!0});R.Hash=R.nextTick=R.byteSwapIfBE=R.isLE=void 0;R.isBytes=df;R.u8=mf;R.u32=ff;R.createView=gf;R.rotr=hf;R.rotl=yf;R.byteSwap=oo;R.byteSwap32=wf;R.bytesToHex=xf;R.hexToBytes=bf;R.asyncLoop=vf;R.utf8ToBytes=ql;R.toBytes=$n;R.concatBytes=Tf;R.checkOpts=Af;R.wrapConstructor=Cf;R.wrapConstructorWithOpts=Sf;R.wrapXOFConstructorWithOpts=Rf;R.randomBytes=If;var kt=$l(),io=eo();function df(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function mf(e){return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}function ff(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function gf(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function hf(e,t){return e<<32-t|e>>>t}function yf(e,t){return e<<t|e>>>32-t>>>0}R.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function oo(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}R.byteSwapIfBE=R.isLE?e=>e:e=>oo(e);function wf(e){for(let t=0;t<e.length;t++)e[t]=oo(e[t])}var Ef=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function xf(e){(0,io.abytes)(e);let t="";for(let r=0;r<e.length;r++)t+=Ef[e[r]];return t}var _e={_0:48,_9:57,A:65,F:70,a:97,f:102};function Vl(e){if(e>=_e._0&&e<=_e._9)return e-_e._0;if(e>=_e.A&&e<=_e.F)return e-(_e.A-10);if(e>=_e.a&&e<=_e.f)return e-(_e.a-10)}function bf(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);let t=e.length,r=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);let n=new Uint8Array(r);for(let i=0,o=0;i<r;i++,o+=2){let s=Vl(e.charCodeAt(o)),a=Vl(e.charCodeAt(o+1));if(s===void 0||a===void 0){let l=e[o]+e[o+1];throw new Error('hex string expected, got non-hex character "'+l+'" at index '+o)}n[i]=s*16+a}return n}var Pf=async()=>{};R.nextTick=Pf;async function vf(e,t,r){let n=Date.now();for(let i=0;i<e;i++){r(i);let o=Date.now()-n;o>=0&&o<t||(await(0,R.nextTick)(),n+=o)}}function ql(e){if(typeof e!="string")throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array(new TextEncoder().encode(e))}function $n(e){return typeof e=="string"&&(e=ql(e)),(0,io.abytes)(e),e}function Tf(...e){let t=0;for(let n=0;n<e.length;n++){let i=e[n];(0,io.abytes)(i),t+=i.length}let r=new Uint8Array(t);for(let n=0,i=0;n<e.length;n++){let o=e[n];r.set(o,i),i+=o.length}return r}var no=class{clone(){return this._cloneInto()}};R.Hash=no;function Af(e,t){if(t!==void 0&&{}.toString.call(t)!=="[object Object]")throw new Error("Options should be object or undefined");return Object.assign(e,t)}function Cf(e){let t=n=>e().update($n(n)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function Sf(e){let t=(n,i)=>e(i).update($n(n)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=n=>e(n),t}function Rf(e){let t=(n,i)=>e(i).update($n(n)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=n=>e(n),t}function If(e=32){if(kt.crypto&&typeof kt.crypto.getRandomValues=="function")return kt.crypto.getRandomValues(new Uint8Array(e));if(kt.crypto&&typeof kt.crypto.randomBytes=="function")return kt.crypto.randomBytes(e);throw new Error("crypto.getRandomValues must be defined")}});var Kl=W($=>{"use strict";Object.defineProperty($,"__esModule",{value:!0});$.shake256=$.shake128=$.keccak_512=$.keccak_384=$.keccak_256=$.keccak_224=$.sha3_512=$.sha3_384=$.sha3_256=$.sha3_224=$.Keccak=void 0;$.keccakP=Wl;var Ot=eo(),Pr=Ll(),Ne=Ul(),Ql=[],Hl=[],Gl=[],kf=BigInt(0),br=BigInt(1),Of=BigInt(2),Df=BigInt(7),_f=BigInt(256),Nf=BigInt(113);for(let e=0,t=br,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],Ql.push(2*(5*n+r)),Hl.push((e+1)*(e+2)/2%64);let i=kf;for(let o=0;o<7;o++)t=(t<<br^(t>>Df)*Nf)%_f,t&Of&&(i^=br<<(br<<BigInt(o))-br);Gl.push(i)}var[Mf,Ff]=(0,Pr.split)(Gl,!0),jl=(e,t,r)=>r>32?(0,Pr.rotlBH)(e,t,r):(0,Pr.rotlSH)(e,t,r),Bl=(e,t,r)=>r>32?(0,Pr.rotlBL)(e,t,r):(0,Pr.rotlSL)(e,t,r);function Wl(e,t=24){let r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let s=0;s<10;s++)r[s]=e[s]^e[s+10]^e[s+20]^e[s+30]^e[s+40];for(let s=0;s<10;s+=2){let a=(s+8)%10,l=(s+2)%10,u=r[l],c=r[l+1],p=jl(u,c,1)^r[a],d=Bl(u,c,1)^r[a+1];for(let f=0;f<50;f+=10)e[s+f]^=p,e[s+f+1]^=d}let i=e[2],o=e[3];for(let s=0;s<24;s++){let a=Hl[s],l=jl(i,o,a),u=Bl(i,o,a),c=Ql[s];i=e[c],o=e[c+1],e[c]=l,e[c+1]=u}for(let s=0;s<50;s+=10){for(let a=0;a<10;a++)r[a]=e[s+a];for(let a=0;a<10;a++)e[s+a]^=~r[(a+2)%10]&r[(a+4)%10]}e[0]^=Mf[n],e[1]^=Ff[n]}r.fill(0)}var vr=class e extends Ne.Hash{constructor(t,r,n,i=!1,o=24){if(super(),this.blockLen=t,this.suffix=r,this.outputLen=n,this.enableXOF=i,this.rounds=o,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,(0,Ot.anumber)(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,Ne.u32)(this.state)}keccak(){Ne.isLE||(0,Ne.byteSwap32)(this.state32),Wl(this.state32,this.rounds),Ne.isLE||(0,Ne.byteSwap32)(this.state32),this.posOut=0,this.pos=0}update(t){(0,Ot.aexists)(this);let{blockLen:r,state:n}=this;t=(0,Ne.toBytes)(t);let i=t.length;for(let o=0;o<i;){let s=Math.min(r-this.pos,i-o);for(let a=0;a<s;a++)n[this.pos++]^=t[o++];this.pos===r&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:t,suffix:r,pos:n,blockLen:i}=this;t[n]^=r,(r&128)!==0&&n===i-1&&this.keccak(),t[i-1]^=128,this.keccak()}writeInto(t){(0,Ot.aexists)(this,!1),(0,Ot.abytes)(t),this.finish();let r=this.state,{blockLen:n}=this;for(let i=0,o=t.length;i<o;){this.posOut>=n&&this.keccak();let s=Math.min(n-this.posOut,o-i);t.set(r.subarray(this.posOut,this.posOut+s),i),this.posOut+=s,i+=s}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return(0,Ot.anumber)(t),this.xofInto(new Uint8Array(t))}digestInto(t){if((0,Ot.aoutput)(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){let{blockLen:r,suffix:n,outputLen:i,rounds:o,enableXOF:s}=this;return t||(t=new e(r,n,i,s,o)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=o,t.suffix=n,t.outputLen=i,t.enableXOF=s,t.destroyed=this.destroyed,t}};$.Keccak=vr;var He=(e,t,r)=>(0,Ne.wrapConstructor)(()=>new vr(t,e,r));$.sha3_224=He(6,144,224/8);$.sha3_256=He(6,136,256/8);$.sha3_384=He(6,104,384/8);$.sha3_512=He(6,72,512/8);$.keccak_224=He(1,144,224/8);$.keccak_256=He(1,136,256/8);$.keccak_384=He(1,104,384/8);$.keccak_512=He(1,72,512/8);var Jl=(e,t,r)=>(0,Ne.wrapXOFConstructorWithOpts)((n={})=>new vr(t,e,n.dkLen===void 0?r:n.dkLen,!0));$.shake128=Jl(31,168,128/8);$.shake256=Jl(31,136,256/8)});var nu=W((iP,Ge)=>{"use strict";var{sha3_512:Lf}=Kl(),Yl=24,Tr=32,so=(e=4,t=Math.random)=>{let r="";for(;r.length<e;)r=r+Math.floor(t()*36).toString(36);return r};function Zl(e){let t=8n,r=0n;for(let n of e.values()){let i=BigInt(n);r=(r<<t)+i}return r}var Xl=(e="")=>Zl(Lf(e)).toString(36).slice(1),zl=Array.from({length:26},(e,t)=>String.fromCharCode(t+97)),$f=e=>zl[Math.floor(e()*zl.length)],eu=({globalObj:e=typeof global<"u"?global:typeof window<"u"?window:{},random:t=Math.random}={})=>{let r=Object.keys(e).toString(),n=r.length?r+so(Tr,t):so(Tr,t);return Xl(n).substring(0,Tr)},tu=e=>()=>e++,Vf=476782367,ru=({random:e=Math.random,counter:t=tu(Math.floor(e()*Vf)),length:r=Yl,fingerprint:n=eu({random:e})}={})=>function(){let o=$f(e),s=Date.now().toString(36),a=t().toString(36),l=so(r,e),u=`${s+l+a+n}`;return`${o+Xl(u).substring(1,r)}`},qf=ru(),Uf=(e,{minLength:t=2,maxLength:r=Tr}={})=>{let n=e.length,i=/^[0-9a-z]+$/;try{if(typeof e=="string"&&n>=t&&n<=r&&i.test(e))return!0}finally{}return!1};Ge.exports.getConstants=()=>({defaultLength:Yl,bigLength:Tr});Ge.exports.init=ru;Ge.exports.createId=qf;Ge.exports.bufToBigInt=Zl;Ge.exports.createCounter=tu;Ge.exports.createFingerprint=eu;Ge.exports.isCuid=Uf});var iu=W((oP,Ar)=>{"use strict";var{createId:jf,init:Bf,getConstants:Qf,isCuid:Hf}=nu();Ar.exports.createId=jf;Ar.exports.init=Bf;Ar.exports.getConstants=Qf;Ar.exports.isCuid=Hf});var Gg={};ct(Gg,{DMMF:()=>rr,Debug:()=>q,Decimal:()=>K,Extensions:()=>si,MetricsClient:()=>Ct,PrismaClientInitializationError:()=>k,PrismaClientKnownRequestError:()=>Q,PrismaClientRustPanicError:()=>ne,PrismaClientUnknownRequestError:()=>X,PrismaClientValidationError:()=>ee,Public:()=>ai,Sql:()=>le,createParam:()=>ga,defineDmmfProperty:()=>ba,deserializeJsonResponse:()=>qe,deserializeRawResult:()=>ri,dmmfToRuntimeDataModel:()=>Us,empty:()=>Aa,getPrismaClient:()=>fc,getRuntime:()=>_n,join:()=>Ta,makeStrictEnum:()=>gc,makeTypedQueryFactory:()=>Pa,objectEnumValues:()=>wn,raw:()=>Li,serializeJsonQuery:()=>An,skip:()=>Tn,sqltag:()=>$i,warnEnvConflicts:()=>hc,warnOnce:()=>Xt});module.exports=Pc(Gg);var si={};ct(si,{defineExtension:()=>Qo,getExtensionContext:()=>Ho});function Qo(e){return typeof e=="function"?e:t=>t.$extends(e)}function Ho(e){return e}var ai={};ct(ai,{validator:()=>Go});function Go(...e){return t=>t}var Jr={};ct(Jr,{$:()=>Yo,bgBlack:()=>Dc,bgBlue:()=>Fc,bgCyan:()=>$c,bgGreen:()=>Nc,bgMagenta:()=>Lc,bgRed:()=>_c,bgWhite:()=>Vc,bgYellow:()=>Mc,black:()=>Rc,blue:()=>ze,bold:()=>re,cyan:()=>Ie,dim:()=>Je,gray:()=>Ht,green:()=>Qt,grey:()=>Oc,hidden:()=>Cc,inverse:()=>Ac,italic:()=>Tc,magenta:()=>Ic,red:()=>Re,reset:()=>vc,strikethrough:()=>Sc,underline:()=>se,white:()=>kc,yellow:()=>Ke});var li,Wo,Jo,Ko,zo=!0;typeof process<"u"&&({FORCE_COLOR:li,NODE_DISABLE_COLORS:Wo,NO_COLOR:Jo,TERM:Ko}=process.env||{},zo=process.stdout&&process.stdout.isTTY);var Yo={enabled:!Wo&&Jo==null&&Ko!=="dumb"&&(li!=null&&li!=="0"||zo)};function M(e,t){let r=new RegExp(`\\x1b\\[${t}m`,"g"),n=`\x1B[${e}m`,i=`\x1B[${t}m`;return function(o){return!Yo.enabled||o==null?o:n+(~(""+o).indexOf(i)?o.replace(r,i+n):o)+i}}var vc=M(0,0),re=M(1,22),Je=M(2,22),Tc=M(3,23),se=M(4,24),Ac=M(7,27),Cc=M(8,28),Sc=M(9,29),Rc=M(30,39),Re=M(31,39),Qt=M(32,39),Ke=M(33,39),ze=M(34,39),Ic=M(35,39),Ie=M(36,39),kc=M(37,39),Ht=M(90,39),Oc=M(90,39),Dc=M(40,49),_c=M(41,49),Nc=M(42,49),Mc=M(43,49),Fc=M(44,49),Lc=M(45,49),$c=M(46,49),Vc=M(47,49);var qc=100,Zo=["green","yellow","blue","magenta","cyan","red"],Gt=[],Xo=Date.now(),Uc=0,ui=typeof process<"u"?process.env:{};globalThis.DEBUG??=ui.DEBUG??"";globalThis.DEBUG_COLORS??=ui.DEBUG_COLORS?ui.DEBUG_COLORS==="true":!0;var Wt={enable(e){typeof e=="string"&&(globalThis.DEBUG=e)},disable(){let e=globalThis.DEBUG;return globalThis.DEBUG="",e},enabled(e){let t=globalThis.DEBUG.split(",").map(i=>i.replace(/[.+?^${}()|[\]\\]/g,"\\$&")),r=t.some(i=>i===""||i[0]==="-"?!1:e.match(RegExp(i.split("*").join(".*")+"$"))),n=t.some(i=>i===""||i[0]!=="-"?!1:e.match(RegExp(i.slice(1).split("*").join(".*")+"$")));return r&&!n},log:(...e)=>{let[t,r,...n]=e;(console.warn??console.log)(`${t} ${r}`,...n)},formatters:{}};function jc(e){let t={color:Zo[Uc++%Zo.length],enabled:Wt.enabled(e),namespace:e,log:Wt.log,extend:()=>{}},r=(...n)=>{let{enabled:i,namespace:o,color:s,log:a}=t;if(n.length!==0&&Gt.push([o,...n]),Gt.length>qc&&Gt.shift(),Wt.enabled(o)||i){let l=n.map(c=>typeof c=="string"?c:Bc(c)),u=`+${Date.now()-Xo}ms`;Xo=Date.now(),globalThis.DEBUG_COLORS?a(Jr[s](re(o)),...l,Jr[s](u)):a(o,...l,u)}};return new Proxy(r,{get:(n,i)=>t[i],set:(n,i,o)=>t[i]=o})}var q=new Proxy(jc,{get:(e,t)=>Wt[t],set:(e,t,r)=>Wt[t]=r});function Bc(e,t=2){let r=new Set;return JSON.stringify(e,(n,i)=>{if(typeof i=="object"&&i!==null){if(r.has(i))return"[Circular *]";r.add(i)}else if(typeof i=="bigint")return i.toString();return i},t)}function es(e=7500){let t=Gt.map(([r,...n])=>`${r} ${n.map(i=>typeof i=="string"?i:JSON.stringify(i)).join(" ")}`).join(`
4
+ `);return t.length<e?t:t.slice(-e)}function ts(){Gt.length=0}var rs=q;var Hc=ns(),ci=Hc.version;function pt(e){let t=Gc();return t||(e?.config.engineType==="library"?"library":e?.config.engineType==="binary"?"binary":e?.config.engineType==="client"?"client":Wc(e))}function Gc(){let e=process.env.PRISMA_CLIENT_ENGINE_TYPE;return e==="library"?"library":e==="binary"?"binary":e==="client"?"client":void 0}function Wc(e){return e?.previewFeatures.includes("queryCompiler")?"client":"library"}var ss=j(os(),1);function pi(e){let t=(0,ss.default)(e);if(t===0)return e;let r=new RegExp(`^[ \\t]{${t}}`,"gm");return e.replace(r,"")}var as="prisma+postgres",Kr=`${as}:`;function zr(e){return e?.toString().startsWith(`${Kr}//`)??!1}function di(e){if(!zr(e))return!1;let{host:t}=new URL(e);return t.includes("localhost")||t.includes("127.0.0.1")}var Kt={};ct(Kt,{error:()=>zc,info:()=>Kc,log:()=>Jc,query:()=>Yc,should:()=>cs,tags:()=>Jt,warn:()=>mi});var Jt={error:Re("prisma:error"),warn:Ke("prisma:warn"),info:Ie("prisma:info"),query:ze("prisma:query")},cs={warn:()=>!process.env.PRISMA_DISABLE_WARNINGS};function Jc(...e){console.log(...e)}function mi(e,...t){cs.warn()&&console.warn(`${Jt.warn} ${e}`,...t)}function Kc(e,...t){console.info(`${Jt.info} ${e}`,...t)}function zc(e,...t){console.error(`${Jt.error} ${e}`,...t)}function Yc(e,...t){console.log(`${Jt.query} ${e}`,...t)}function fe(e,t){throw new Error(t)}var zt=j(require("node:path"));function gi(e){return zt.default.sep===zt.default.posix.sep?e:e.split(zt.default.sep).join(zt.default.posix.sep)}var Ei=j(Es()),Yr=j(require("node:fs"));var dt=j(require("node:path"));function xs(e){let t=e.ignoreProcessEnv?{}:process.env,r=n=>n.match(/(.?\${(?:[a-zA-Z0-9_]+)?})/g)?.reduce(function(o,s){let a=/(.?)\${([a-zA-Z0-9_]+)?}/g.exec(s);if(!a)return o;let l=a[1],u,c;if(l==="\\")c=a[0],u=c.replace("\\$","$");else{let p=a[2];c=a[0].substring(l.length),u=Object.hasOwnProperty.call(t,p)?t[p]:e.parsed[p]||"",u=r(u)}return o.replace(c,u)},n)??n;for(let n in e.parsed){let i=Object.hasOwnProperty.call(t,n)?t[n]:e.parsed[n];e.parsed[n]=r(i)}for(let n in e.parsed)t[n]=e.parsed[n];return e}var wi=rs("prisma:tryLoadEnv");function Zt({rootEnvPath:e,schemaEnvPath:t},r={conflictCheck:"none"}){let n=bs(e);r.conflictCheck!=="none"&&mp(n,t,r.conflictCheck);let i=null;return Ps(n?.path,t)||(i=bs(t)),!n&&!i&&wi("No Environment variables loaded"),i?.dotenvResult.error?console.error(Re(re("Schema Env Error: "))+i.dotenvResult.error):{message:[n?.message,i?.message].filter(Boolean).join(`
5
+ `),parsed:{...n?.dotenvResult?.parsed,...i?.dotenvResult?.parsed}}}function mp(e,t,r){let n=e?.dotenvResult.parsed,i=!Ps(e?.path,t);if(n&&t&&i&&Yr.default.existsSync(t)){let o=Ei.default.parse(Yr.default.readFileSync(t)),s=[];for(let a in o)n[a]===o[a]&&s.push(a);if(s.length>0){let a=dt.default.relative(process.cwd(),e.path),l=dt.default.relative(process.cwd(),t);if(r==="error"){let u=`There is a conflict between env var${s.length>1?"s":""} in ${se(a)} and ${se(l)}
6
6
  Conflicting env vars:
7
7
  ${s.map(c=>` ${re(c)}`).join(`
8
8
  `)}
@@ -10,19 +10,19 @@ ${s.map(c=>` ${re(c)}`).join(`
10
10
  We suggest to move the contents of ${se(l)} to ${se(a)} to consolidate your env vars.
11
11
  `;throw new Error(u)}else if(r==="warn"){let u=`Conflict for env var${s.length>1?"s":""} ${s.map(c=>re(c)).join(", ")} in ${se(a)} and ${se(l)}
12
12
  Env vars from ${se(l)} overwrite the ones from ${se(a)}
13
- `;console.warn(`${Ke("warn(prisma)")} ${u}`)}}}}function bs(e){if(gp(e)){wi(`Environment variables loaded from ${e}`);let t=Ei.default.config({path:e,debug:process.env.DOTENV_CONFIG_DEBUG?!0:void 0});return{dotenvResult:xs(t),message:Je(`Environment variables loaded from ${dt.default.relative(process.cwd(),e)}`),path:e}}else wi(`Environment variables not found at ${e}`);return null}function Ps(e,t){return e&&t&&dt.default.resolve(e)===dt.default.resolve(t)}function gp(e){return!!(e&&Yr.default.existsSync(e))}function xi(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function mt(e,t){let r={};for(let n of Object.keys(e))r[n]=t(e[n],n);return r}function bi(e,t){if(e.length===0)return;let r=e[0];for(let n=1;n<e.length;n++)t(r,e[n])<0&&(r=e[n]);return r}function b(e,t){Object.defineProperty(e,"name",{value:t,configurable:!0})}var Ts=new Set,Xt=(e,t,...r)=>{Ts.has(e)||(Ts.add(e),mi(t,...r))};var k=class e extends Error{clientVersion;errorCode;retryable;constructor(t,r,n){super(t),this.name="PrismaClientInitializationError",this.clientVersion=r,this.errorCode=n,Error.captureStackTrace(e)}get[Symbol.toStringTag](){return"PrismaClientInitializationError"}};b(k,"PrismaClientInitializationError");var Q=class extends Error{code;meta;clientVersion;batchRequestIdx;constructor(t,{code:r,clientVersion:n,meta:i,batchRequestIdx:o}){super(t),this.name="PrismaClientKnownRequestError",this.code=r,this.clientVersion=n,this.meta=i,Object.defineProperty(this,"batchRequestIdx",{value:o,enumerable:!1,writable:!0})}get[Symbol.toStringTag](){return"PrismaClientKnownRequestError"}};b(Q,"PrismaClientKnownRequestError");var ne=class extends Error{clientVersion;constructor(t,r){super(t),this.name="PrismaClientRustPanicError",this.clientVersion=r}get[Symbol.toStringTag](){return"PrismaClientRustPanicError"}};b(ne,"PrismaClientRustPanicError");var X=class extends Error{clientVersion;batchRequestIdx;constructor(t,{clientVersion:r,batchRequestIdx:n}){super(t),this.name="PrismaClientUnknownRequestError",this.clientVersion=r,Object.defineProperty(this,"batchRequestIdx",{value:n,writable:!0,enumerable:!1})}get[Symbol.toStringTag](){return"PrismaClientUnknownRequestError"}};b(X,"PrismaClientUnknownRequestError");var ee=class extends Error{name="PrismaClientValidationError";clientVersion;constructor(t,{clientVersion:r}){super(t),this.clientVersion=r}get[Symbol.toStringTag](){return"PrismaClientValidationError"}};b(ee,"PrismaClientValidationError");var ft=9e15,Ve=1e9,Pi="0123456789abcdef",tn="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",rn="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",vi={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-ft,maxE:ft,crypto:!1},Is,Oe,x=!0,on="[DecimalError] ",$e=on+"Invalid argument: ",ks=on+"Precision limit exceeded",Os=on+"crypto unavailable",Ds="[object Decimal]",te=Math.floor,H=Math.pow,yp=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,hp=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,wp=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,_s=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,ge=1e7,E=7,Ep=9007199254740991,xp=tn.length-1,Ti=rn.length-1,f={toStringTag:Ds};f.absoluteValue=f.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),h(e)};f.ceil=function(){return h(new this.constructor(this),this.e+1,2)};f.clampedTo=f.clamp=function(e,t){var r,n=this,i=n.constructor;if(e=new i(e),t=new i(t),!e.s||!t.s)return new i(NaN);if(e.gt(t))throw Error($e+t);return r=n.cmp(e),r<0?e:n.cmp(t)>0?t:new i(n)};f.comparedTo=f.cmp=function(e){var t,r,n,i,o=this,s=o.d,a=(e=new o.constructor(e)).d,l=o.s,u=e.s;if(!s||!a)return!l||!u?NaN:l!==u?l:s===a?0:!s^l<0?1:-1;if(!s[0]||!a[0])return s[0]?l:a[0]?-u:0;if(l!==u)return l;if(o.e!==e.e)return o.e>e.e^l<0?1:-1;for(n=s.length,i=a.length,t=0,r=n<i?n:i;t<r;++t)if(s[t]!==a[t])return s[t]>a[t]^l<0?1:-1;return n===i?0:n>i^l<0?1:-1};f.cosine=f.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())+E,n.rounding=1,r=bp(n,$s(n,r)),n.precision=e,n.rounding=t,h(Oe==2||Oe==3?r.neg():r,e,t,!0)):new n(1):new n(NaN)};f.cubeRoot=f.cbrt=function(){var e,t,r,n,i,o,s,a,l,u,c=this,p=c.constructor;if(!c.isFinite()||c.isZero())return new p(c);for(x=!1,o=c.s*H(c.s*c,1/3),!o||Math.abs(o)==1/0?(r=J(c.d),e=c.e,(o=(e-r.length+1)%3)&&(r+=o==1||o==-2?"0":"00"),o=H(r,1/3),e=te((e+1)/3)-(e%3==(e<0?-1:2)),o==1/0?r="5e"+e:(r=o.toExponential(),r=r.slice(0,r.indexOf("e")+1)+e),n=new p(r),n.s=c.s):n=new p(o.toString()),s=(e=p.precision)+3;;)if(a=n,l=a.times(a).times(a),u=l.plus(c),n=N(u.plus(c).times(a),u.plus(l),s+2,1),J(a.d).slice(0,s)===(r=J(n.d)).slice(0,s))if(r=r.slice(s-3,s+1),r=="9999"||!i&&r=="4999"){if(!i&&(h(a,e+1,0),a.times(a).times(a).eq(c))){n=a;break}s+=4,i=1}else{(!+r||!+r.slice(1)&&r.charAt(0)=="5")&&(h(n,e+1,1),t=!n.times(n).times(n).eq(c));break}return x=!0,h(n,e,p.rounding,t)};f.decimalPlaces=f.dp=function(){var e,t=this.d,r=NaN;if(t){if(e=t.length-1,r=(e-te(this.e/E))*E,e=t[e],e)for(;e%10==0;e/=10)r--;r<0&&(r=0)}return r};f.dividedBy=f.div=function(e){return N(this,new this.constructor(e))};f.dividedToIntegerBy=f.divToInt=function(e){var t=this,r=t.constructor;return h(N(t,new r(e),0,1,1),r.precision,r.rounding)};f.equals=f.eq=function(e){return this.cmp(e)===0};f.floor=function(){return h(new this.constructor(this),this.e+1,3)};f.greaterThan=f.gt=function(e){return this.cmp(e)>0};f.greaterThanOrEqualTo=f.gte=function(e){var t=this.cmp(e);return t==1||t===0};f.hyperbolicCosine=f.cosh=function(){var e,t,r,n,i,o=this,s=o.constructor,a=new s(1);if(!o.isFinite())return new s(o.s?1/0:NaN);if(o.isZero())return a;r=s.precision,n=s.rounding,s.precision=r+Math.max(o.e,o.sd())+4,s.rounding=1,i=o.d.length,i<32?(e=Math.ceil(i/3),t=(1/an(4,e)).toString()):(e=16,t="2.3283064365386962890625e-10"),o=gt(s,1,o.times(t),new s(1),!0);for(var l,u=e,c=new s(8);u--;)l=o.times(o),o=a.minus(l.times(c.minus(l.times(c))));return h(o,s.precision=r,s.rounding=n,!0)};f.hyperbolicSine=f.sinh=function(){var e,t,r,n,i=this,o=i.constructor;if(!i.isFinite()||i.isZero())return new o(i);if(t=o.precision,r=o.rounding,o.precision=t+Math.max(i.e,i.sd())+4,o.rounding=1,n=i.d.length,n<3)i=gt(o,2,i,i,!0);else{e=1.4*Math.sqrt(n),e=e>16?16:e|0,i=i.times(1/an(5,e)),i=gt(o,2,i,i,!0);for(var s,a=new o(5),l=new o(16),u=new o(20);e--;)s=i.times(i),i=i.times(a.plus(s.times(l.times(s).plus(u))))}return o.precision=t,o.rounding=r,h(i,t,r,!0)};f.hyperbolicTangent=f.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,N(r.sinh(),r.cosh(),n.precision=e,n.rounding=t)):new n(r.s)};f.inverseCosine=f.acos=function(){var e=this,t=e.constructor,r=e.abs().cmp(1),n=t.precision,i=t.rounding;return r!==-1?r===0?e.isNeg()?Ee(t,n,i):new t(0):new t(NaN):e.isZero()?Ee(t,n+4,i).times(.5):(t.precision=n+6,t.rounding=1,e=new t(1).minus(e).div(e.plus(1)).sqrt().atan(),t.precision=n,t.rounding=i,e.times(2))};f.inverseHyperbolicCosine=f.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,x=!1,r=r.times(r).minus(1).sqrt().plus(r),x=!0,n.precision=e,n.rounding=t,r.ln()):new n(r)};f.inverseHyperbolicSine=f.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,x=!1,r=r.times(r).plus(1).sqrt().plus(r),x=!0,n.precision=e,n.rounding=t,r.ln())};f.inverseHyperbolicTangent=f.atanh=function(){var e,t,r,n,i=this,o=i.constructor;return i.isFinite()?i.e>=0?new o(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(e=o.precision,t=o.rounding,n=i.sd(),Math.max(n,e)<2*-i.e-1?h(new o(i),e,t,!0):(o.precision=r=n-i.e,i=N(i.plus(1),new o(1).minus(i),r+e,1),o.precision=e+4,o.rounding=1,i=i.ln(),o.precision=e,o.rounding=t,i.times(.5))):new o(NaN)};f.inverseSine=f.asin=function(){var e,t,r,n,i=this,o=i.constructor;return i.isZero()?new o(i):(t=i.abs().cmp(1),r=o.precision,n=o.rounding,t!==-1?t===0?(e=Ee(o,r+4,n).times(.5),e.s=i.s,e):new o(NaN):(o.precision=r+6,o.rounding=1,i=i.div(new o(1).minus(i.times(i)).sqrt().plus(1)).atan(),o.precision=r,o.rounding=n,i.times(2)))};f.inverseTangent=f.atan=function(){var e,t,r,n,i,o,s,a,l,u=this,c=u.constructor,p=c.precision,d=c.rounding;if(u.isFinite()){if(u.isZero())return new c(u);if(u.abs().eq(1)&&p+4<=Ti)return s=Ee(c,p+4,d).times(.25),s.s=u.s,s}else{if(!u.s)return new c(NaN);if(p+4<=Ti)return s=Ee(c,p+4,d).times(.5),s.s=u.s,s}for(c.precision=a=p+10,c.rounding=1,r=Math.min(28,a/E+2|0),e=r;e;--e)u=u.div(u.times(u).plus(1).sqrt().plus(1));for(x=!1,t=Math.ceil(a/E),n=1,l=u.times(u),s=new c(u),i=u;e!==-1;)if(i=i.times(l),o=s.minus(i.div(n+=2)),i=i.times(l),s=o.plus(i.div(n+=2)),s.d[t]!==void 0)for(e=t;s.d[e]===o.d[e]&&e--;);return r&&(s=s.times(2<<r-1)),x=!0,h(s,c.precision=p,c.rounding=d,!0)};f.isFinite=function(){return!!this.d};f.isInteger=f.isInt=function(){return!!this.d&&te(this.e/E)>this.d.length-2};f.isNaN=function(){return!this.s};f.isNegative=f.isNeg=function(){return this.s<0};f.isPositive=f.isPos=function(){return this.s>0};f.isZero=function(){return!!this.d&&this.d[0]===0};f.lessThan=f.lt=function(e){return this.cmp(e)<0};f.lessThanOrEqualTo=f.lte=function(e){return this.cmp(e)<1};f.logarithm=f.log=function(e){var t,r,n,i,o,s,a,l,u=this,c=u.constructor,p=c.precision,d=c.rounding,m=5;if(e==null)e=new c(10),t=!0;else{if(e=new c(e),r=e.d,e.s<0||!r||!r[0]||e.eq(1))return new c(NaN);t=e.eq(10)}if(r=u.d,u.s<0||!r||!r[0]||u.eq(1))return new c(r&&!r[0]?-1/0:u.s!=1?NaN:r?0:1/0);if(t)if(r.length>1)o=!0;else{for(i=r[0];i%10===0;)i/=10;o=i!==1}if(x=!1,a=p+m,s=Le(u,a),n=t?nn(c,a+10):Le(e,a),l=N(s,n,a,1),er(l.d,i=p,d))do if(a+=10,s=Le(u,a),n=t?nn(c,a+10):Le(e,a),l=N(s,n,a,1),!o){+J(l.d).slice(i+1,i+15)+1==1e14&&(l=h(l,p+1,0));break}while(er(l.d,i+=10,d));return x=!0,h(l,p,d)};f.minus=f.sub=function(e){var t,r,n,i,o,s,a,l,u,c,p,d,m=this,g=m.constructor;if(e=new g(e),!m.d||!e.d)return!m.s||!e.s?e=new g(NaN):m.d?e.s=-e.s:e=new g(e.d||m.s!==e.s?m:NaN),e;if(m.s!=e.s)return e.s=-e.s,m.plus(e);if(u=m.d,d=e.d,a=g.precision,l=g.rounding,!u[0]||!d[0]){if(d[0])e.s=-e.s;else if(u[0])e=new g(m);else return new g(l===3?-0:0);return x?h(e,a,l):e}if(r=te(e.e/E),c=te(m.e/E),u=u.slice(),o=c-r,o){for(p=o<0,p?(t=u,o=-o,s=d.length):(t=d,r=c,s=u.length),n=Math.max(Math.ceil(a/E),s)+2,o>n&&(o=n,t.length=1),t.reverse(),n=o;n--;)t.push(0);t.reverse()}else{for(n=u.length,s=d.length,p=n<s,p&&(s=n),n=0;n<s;n++)if(u[n]!=d[n]){p=u[n]<d[n];break}o=0}for(p&&(t=u,u=d,d=t,e.s=-e.s),s=u.length,n=d.length-s;n>0;--n)u[s++]=0;for(n=d.length;n>o;){if(u[--n]<d[n]){for(i=n;i&&u[--i]===0;)u[i]=ge-1;--u[i],u[n]+=ge}u[n]-=d[n]}for(;u[--s]===0;)u.pop();for(;u[0]===0;u.shift())--r;return u[0]?(e.d=u,e.e=sn(u,r),x?h(e,a,l):e):new g(l===3?-0:0)};f.modulo=f.mod=function(e){var t,r=this,n=r.constructor;return e=new n(e),!r.d||!e.s||e.d&&!e.d[0]?new n(NaN):!e.d||r.d&&!r.d[0]?h(new n(r),n.precision,n.rounding):(x=!1,n.modulo==9?(t=N(r,e.abs(),0,3,1),t.s*=e.s):t=N(r,e,0,n.modulo,1),t=t.times(e),x=!0,r.minus(t))};f.naturalExponential=f.exp=function(){return Ai(this)};f.naturalLogarithm=f.ln=function(){return Le(this)};f.negated=f.neg=function(){var e=new this.constructor(this);return e.s=-e.s,h(e)};f.plus=f.add=function(e){var t,r,n,i,o,s,a,l,u,c,p=this,d=p.constructor;if(e=new d(e),!p.d||!e.d)return!p.s||!e.s?e=new d(NaN):p.d||(e=new d(e.d||p.s===e.s?p:NaN)),e;if(p.s!=e.s)return e.s=-e.s,p.minus(e);if(u=p.d,c=e.d,a=d.precision,l=d.rounding,!u[0]||!c[0])return c[0]||(e=new d(p)),x?h(e,a,l):e;if(o=te(p.e/E),n=te(e.e/E),u=u.slice(),i=o-n,i){for(i<0?(r=u,i=-i,s=c.length):(r=c,n=o,s=u.length),o=Math.ceil(a/E),s=o>s?o+1:s+1,i>s&&(i=s,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for(s=u.length,i=c.length,s-i<0&&(i=s,r=c,c=u,u=r),t=0;i;)t=(u[--i]=u[i]+c[i]+t)/ge|0,u[i]%=ge;for(t&&(u.unshift(t),++n),s=u.length;u[--s]==0;)u.pop();return e.d=u,e.e=sn(u,n),x?h(e,a,l):e};f.precision=f.sd=function(e){var t,r=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error($e+e);return r.d?(t=Ns(r.d),e&&r.e+1>t&&(t=r.e+1)):t=NaN,t};f.round=function(){var e=this,t=e.constructor;return h(new t(e),e.e+1,t.rounding)};f.sine=f.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())+E,n.rounding=1,r=vp(n,$s(n,r)),n.precision=e,n.rounding=t,h(Oe>2?r.neg():r,e,t,!0)):new n(NaN)};f.squareRoot=f.sqrt=function(){var e,t,r,n,i,o,s=this,a=s.d,l=s.e,u=s.s,c=s.constructor;if(u!==1||!a||!a[0])return new c(!u||u<0&&(!a||a[0])?NaN:a?s:1/0);for(x=!1,u=Math.sqrt(+s),u==0||u==1/0?(t=J(a),(t.length+l)%2==0&&(t+="0"),u=Math.sqrt(t),l=te((l+1)/2)-(l<0||l%2),u==1/0?t="5e"+l:(t=u.toExponential(),t=t.slice(0,t.indexOf("e")+1)+l),n=new c(t)):n=new c(u.toString()),r=(l=c.precision)+3;;)if(o=n,n=o.plus(N(s,o,r+2,1)).times(.5),J(o.d).slice(0,r)===(t=J(n.d)).slice(0,r))if(t=t.slice(r-3,r+1),t=="9999"||!i&&t=="4999"){if(!i&&(h(o,l+1,0),o.times(o).eq(s))){n=o;break}r+=4,i=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(h(n,l+1,1),e=!n.times(n).eq(s));break}return x=!0,h(n,l,c.rounding,e)};f.tangent=f.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=N(r,new n(1).minus(r.times(r)).sqrt(),e+10,0),n.precision=e,n.rounding=t,h(Oe==2||Oe==4?r.neg():r,e,t,!0)):new n(NaN)};f.times=f.mul=function(e){var t,r,n,i,o,s,a,l,u,c=this,p=c.constructor,d=c.d,m=(e=new p(e)).d;if(e.s*=c.s,!d||!d[0]||!m||!m[0])return new p(!e.s||d&&!d[0]&&!m||m&&!m[0]&&!d?NaN:!d||!m?e.s/0:e.s*0);for(r=te(c.e/E)+te(e.e/E),l=d.length,u=m.length,l<u&&(o=d,d=m,m=o,s=l,l=u,u=s),o=[],s=l+u,n=s;n--;)o.push(0);for(n=u;--n>=0;){for(t=0,i=l+n;i>n;)a=o[i]+m[n]*d[i-n-1]+t,o[i--]=a%ge|0,t=a/ge|0;o[i]=(o[i]+t)%ge|0}for(;!o[--s];)o.pop();return t?++r:o.shift(),e.d=o,e.e=sn(o,r),x?h(e,p.precision,p.rounding):e};f.toBinary=function(e,t){return Ci(this,2,e,t)};f.toDecimalPlaces=f.toDP=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(ae(e,0,Ve),t===void 0?t=n.rounding:ae(t,0,8),h(r,e+r.e+1,t))};f.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=xe(n,!0):(ae(e,0,Ve),t===void 0?t=i.rounding:ae(t,0,8),n=h(new i(n),e+1,t),r=xe(n,!0,e+1)),n.isNeg()&&!n.isZero()?"-"+r:r};f.toFixed=function(e,t){var r,n,i=this,o=i.constructor;return e===void 0?r=xe(i):(ae(e,0,Ve),t===void 0?t=o.rounding:ae(t,0,8),n=h(new o(i),e+i.e+1,t),r=xe(n,!1,e+n.e+1)),i.isNeg()&&!i.isZero()?"-"+r:r};f.toFraction=function(e){var t,r,n,i,o,s,a,l,u,c,p,d,m=this,g=m.d,y=m.constructor;if(!g)return new y(m);if(u=r=new y(1),n=l=new y(0),t=new y(n),o=t.e=Ns(g)-m.e-1,s=o%E,t.d[0]=H(10,s<0?E+s:s),e==null)e=o>0?t:u;else{if(a=new y(e),!a.isInt()||a.lt(u))throw Error($e+a);e=a.gt(t)?o>0?t:u:a}for(x=!1,a=new y(J(g)),c=y.precision,y.precision=o=g.length*E*2;p=N(a,t,0,1,1),i=r.plus(p.times(n)),i.cmp(e)!=1;)r=n,n=i,i=u,u=l.plus(p.times(i)),l=i,i=t,t=a.minus(p.times(i)),a=i;return i=N(e.minus(r),n,0,1,1),l=l.plus(i.times(u)),r=r.plus(i.times(n)),l.s=u.s=m.s,d=N(u,n,o,1).minus(m).abs().cmp(N(l,r,o,1).minus(m).abs())<1?[u,n]:[l,r],y.precision=c,x=!0,d};f.toHexadecimal=f.toHex=function(e,t){return Ci(this,16,e,t)};f.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:ae(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]?(x=!1,r=N(r,e,0,t,1).times(e),x=!0,h(r)):(e.s=r.s,r=e),r};f.toNumber=function(){return+this};f.toOctal=function(e,t){return Ci(this,8,e,t)};f.toPower=f.pow=function(e){var t,r,n,i,o,s,a=this,l=a.constructor,u=+(e=new l(e));if(!a.d||!e.d||!a.d[0]||!e.d[0])return new l(H(+a,u));if(a=new l(a),a.eq(1))return a;if(n=l.precision,o=l.rounding,e.eq(1))return h(a,n,o);if(t=te(e.e/E),t>=e.d.length-1&&(r=u<0?-u:u)<=Ep)return i=Ms(l,a,r,n),e.s<0?new l(1).div(i):h(i,n,o);if(s=a.s,s<0){if(t<e.d.length-1)return new l(NaN);if((e.d[t]&1)==0&&(s=1),a.e==0&&a.d[0]==1&&a.d.length==1)return a.s=s,a}return r=H(+a,u),t=r==0||!isFinite(r)?te(u*(Math.log("0."+J(a.d))/Math.LN10+a.e+1)):new l(r+"").e,t>l.maxE+1||t<l.minE-1?new l(t>0?s/0:0):(x=!1,l.rounding=a.s=1,r=Math.min(12,(t+"").length),i=Ai(e.times(Le(a,n+r)),n),i.d&&(i=h(i,n+5,1),er(i.d,n,o)&&(t=n+10,i=h(Ai(e.times(Le(a,t+r)),t),t+5,1),+J(i.d).slice(n+1,n+15)+1==1e14&&(i=h(i,n+1,0)))),i.s=s,x=!0,l.rounding=o,h(i,n,o))};f.toPrecision=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=xe(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(ae(e,1,Ve),t===void 0?t=i.rounding:ae(t,0,8),n=h(new i(n),e,t),r=xe(n,e<=n.e||n.e<=i.toExpNeg,e)),n.isNeg()&&!n.isZero()?"-"+r:r};f.toSignificantDigits=f.toSD=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(ae(e,1,Ve),t===void 0?t=n.rounding:ae(t,0,8)),h(new n(r),e,t)};f.toString=function(){var e=this,t=e.constructor,r=xe(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+r:r};f.truncated=f.trunc=function(){return h(new this.constructor(this),this.e+1,1)};f.valueOf=f.toJSON=function(){var e=this,t=e.constructor,r=xe(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+r:r};function J(e){var t,r,n,i=e.length-1,o="",s=e[0];if(i>0){for(o+=s,t=1;t<i;t++)n=e[t]+"",r=E-n.length,r&&(o+=Fe(r)),o+=n;s=e[t],n=s+"",r=E-n.length,r&&(o+=Fe(r))}else if(s===0)return"0";for(;s%10===0;)s/=10;return o+s}function ae(e,t,r){if(e!==~~e||e<t||e>r)throw Error($e+e)}function er(e,t,r,n){var i,o,s,a;for(o=e[0];o>=10;o/=10)--t;return--t<0?(t+=E,i=0):(i=Math.ceil((t+1)/E),t%=E),o=H(10,E-t),a=e[i]%o|0,n==null?t<3?(t==0?a=a/100|0:t==1&&(a=a/10|0),s=r<4&&a==99999||r>3&&a==49999||a==5e4||a==0):s=(r<4&&a+1==o||r>3&&a+1==o/2)&&(e[i+1]/o/100|0)==H(10,t-2)-1||(a==o/2||a==0)&&(e[i+1]/o/100|0)==0:t<4?(t==0?a=a/1e3|0:t==1?a=a/100|0:t==2&&(a=a/10|0),s=(n||r<4)&&a==9999||!n&&r>3&&a==4999):s=((n||r<4)&&a+1==o||!n&&r>3&&a+1==o/2)&&(e[i+1]/o/1e3|0)==H(10,t-3)-1,s}function Xr(e,t,r){for(var n,i=[0],o,s=0,a=e.length;s<a;){for(o=i.length;o--;)i[o]*=t;for(i[0]+=Pi.indexOf(e.charAt(s++)),n=0;n<i.length;n++)i[n]>r-1&&(i[n+1]===void 0&&(i[n+1]=0),i[n+1]+=i[n]/r|0,i[n]%=r)}return i.reverse()}function bp(e,t){var r,n,i;if(t.isZero())return t;n=t.d.length,n<32?(r=Math.ceil(n/3),i=(1/an(4,r)).toString()):(r=16,i="2.3283064365386962890625e-10"),e.precision+=r,t=gt(e,1,t.times(i),new e(1));for(var o=r;o--;){var s=t.times(t);t=s.times(s).minus(s).times(8).plus(1)}return e.precision-=r,t}var N=function(){function e(n,i,o){var s,a=0,l=n.length;for(n=n.slice();l--;)s=n[l]*i+a,n[l]=s%o|0,a=s/o|0;return a&&n.unshift(a),n}function t(n,i,o,s){var a,l;if(o!=s)l=o>s?1:-1;else for(a=l=0;a<o;a++)if(n[a]!=i[a]){l=n[a]>i[a]?1:-1;break}return l}function r(n,i,o,s){for(var a=0;o--;)n[o]-=a,a=n[o]<i[o]?1:0,n[o]=a*s+n[o]-i[o];for(;!n[0]&&n.length>1;)n.shift()}return function(n,i,o,s,a,l){var u,c,p,d,m,g,y,I,A,C,w,O,me,ce,Bt,U,oe,Se,Y,ut,Gr=n.constructor,oi=n.s==i.s?1:-1,Z=n.d,_=i.d;if(!Z||!Z[0]||!_||!_[0])return new Gr(!n.s||!i.s||(Z?_&&Z[0]==_[0]:!_)?NaN:Z&&Z[0]==0||!_?oi*0:oi/0);for(l?(m=1,c=n.e-i.e):(l=ge,m=E,c=te(n.e/m)-te(i.e/m)),Y=_.length,oe=Z.length,A=new Gr(oi),C=A.d=[],p=0;_[p]==(Z[p]||0);p++);if(_[p]>(Z[p]||0)&&c--,o==null?(ce=o=Gr.precision,s=Gr.rounding):a?ce=o+(n.e-i.e)+1:ce=o,ce<0)C.push(1),g=!0;else{if(ce=ce/m+2|0,p=0,Y==1){for(d=0,_=_[0],ce++;(p<oe||d)&&ce--;p++)Bt=d*l+(Z[p]||0),C[p]=Bt/_|0,d=Bt%_|0;g=d||p<oe}else{for(d=l/(_[0]+1)|0,d>1&&(_=e(_,d,l),Z=e(Z,d,l),Y=_.length,oe=Z.length),U=Y,w=Z.slice(0,Y),O=w.length;O<Y;)w[O++]=0;ut=_.slice(),ut.unshift(0),Se=_[0],_[1]>=l/2&&++Se;do d=0,u=t(_,w,Y,O),u<0?(me=w[0],Y!=O&&(me=me*l+(w[1]||0)),d=me/Se|0,d>1?(d>=l&&(d=l-1),y=e(_,d,l),I=y.length,O=w.length,u=t(y,w,I,O),u==1&&(d--,r(y,Y<I?ut:_,I,l))):(d==0&&(u=d=1),y=_.slice()),I=y.length,I<O&&y.unshift(0),r(w,y,O,l),u==-1&&(O=w.length,u=t(_,w,Y,O),u<1&&(d++,r(w,Y<O?ut:_,O,l))),O=w.length):u===0&&(d++,w=[0]),C[p++]=d,u&&w[0]?w[O++]=Z[U]||0:(w=[Z[U]],O=1);while((U++<oe||w[0]!==void 0)&&ce--);g=w[0]!==void 0}C[0]||C.shift()}if(m==1)A.e=c,Is=g;else{for(p=1,d=C[0];d>=10;d/=10)p++;A.e=p+c*m-1,h(A,a?o+A.e+1:o,s,g)}return A}}();function h(e,t,r,n){var i,o,s,a,l,u,c,p,d,m=e.constructor;e:if(t!=null){if(p=e.d,!p)return e;for(i=1,a=p[0];a>=10;a/=10)i++;if(o=t-i,o<0)o+=E,s=t,c=p[d=0],l=c/H(10,i-s-1)%10|0;else if(d=Math.ceil((o+1)/E),a=p.length,d>=a)if(n){for(;a++<=d;)p.push(0);c=l=0,i=1,o%=E,s=o-E+1}else break e;else{for(c=a=p[d],i=1;a>=10;a/=10)i++;o%=E,s=o-E+i,l=s<0?0:c/H(10,i-s-1)%10|0}if(n=n||t<0||p[d+1]!==void 0||(s<0?c:c%H(10,i-s-1)),u=r<4?(l||n)&&(r==0||r==(e.s<0?3:2)):l>5||l==5&&(r==4||n||r==6&&(o>0?s>0?c/H(10,i-s):0:p[d-1])%10&1||r==(e.s<0?8:7)),t<1||!p[0])return p.length=0,u?(t-=e.e+1,p[0]=H(10,(E-t%E)%E),e.e=-t||0):p[0]=e.e=0,e;if(o==0?(p.length=d,a=1,d--):(p.length=d+1,a=H(10,E-o),p[d]=s>0?(c/H(10,i-s)%H(10,s)|0)*a:0),u)for(;;)if(d==0){for(o=1,s=p[0];s>=10;s/=10)o++;for(s=p[0]+=a,a=1;s>=10;s/=10)a++;o!=a&&(e.e++,p[0]==ge&&(p[0]=1));break}else{if(p[d]+=a,p[d]!=ge)break;p[d--]=0,a=1}for(o=p.length;p[--o]===0;)p.pop()}return x&&(e.e>m.maxE?(e.d=null,e.e=NaN):e.e<m.minE&&(e.e=0,e.d=[0])),e}function xe(e,t,r){if(!e.isFinite())return Ls(e);var n,i=e.e,o=J(e.d),s=o.length;return t?(r&&(n=r-s)>0?o=o.charAt(0)+"."+o.slice(1)+Fe(n):s>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(e.e<0?"e":"e+")+e.e):i<0?(o="0."+Fe(-i-1)+o,r&&(n=r-s)>0&&(o+=Fe(n))):i>=s?(o+=Fe(i+1-s),r&&(n=r-i-1)>0&&(o=o+"."+Fe(n))):((n=i+1)<s&&(o=o.slice(0,n)+"."+o.slice(n)),r&&(n=r-s)>0&&(i+1===s&&(o+="."),o+=Fe(n))),o}function sn(e,t){var r=e[0];for(t*=E;r>=10;r/=10)t++;return t}function nn(e,t,r){if(t>xp)throw x=!0,r&&(e.precision=r),Error(ks);return h(new e(tn),t,1,!0)}function Ee(e,t,r){if(t>Ti)throw Error(ks);return h(new e(rn),t,r,!0)}function Ns(e){var t=e.length-1,r=t*E+1;if(t=e[t],t){for(;t%10==0;t/=10)r--;for(t=e[0];t>=10;t/=10)r++}return r}function Fe(e){for(var t="";e--;)t+="0";return t}function Ms(e,t,r,n){var i,o=new e(1),s=Math.ceil(n/E+4);for(x=!1;;){if(r%2&&(o=o.times(t),Ss(o.d,s)&&(i=!0)),r=te(r/2),r===0){r=o.d.length-1,i&&o.d[r]===0&&++o.d[r];break}t=t.times(t),Ss(t.d,s)}return x=!0,o}function Cs(e){return e.d[e.d.length-1]&1}function Fs(e,t,r){for(var n,i,o=new e(t[0]),s=0;++s<t.length;){if(i=new e(t[s]),!i.s){o=i;break}n=o.cmp(i),(n===r||n===0&&o.s===r)&&(o=i)}return o}function Ai(e,t){var r,n,i,o,s,a,l,u=0,c=0,p=0,d=e.constructor,m=d.rounding,g=d.precision;if(!e.d||!e.d[0]||e.e>17)return new d(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(t==null?(x=!1,l=g):l=t,a=new d(.03125);e.e>-2;)e=e.times(a),p+=5;for(n=Math.log(H(2,p))/Math.LN10*2+5|0,l+=n,r=o=s=new d(1),d.precision=l;;){if(o=h(o.times(e),l,1),r=r.times(++c),a=s.plus(N(o,r,l,1)),J(a.d).slice(0,l)===J(s.d).slice(0,l)){for(i=p;i--;)s=h(s.times(s),l,1);if(t==null)if(u<3&&er(s.d,l-n,m,u))d.precision=l+=10,r=o=a=new d(1),c=0,u++;else return h(s,d.precision=g,m,x=!0);else return d.precision=g,s}s=a}}function Le(e,t){var r,n,i,o,s,a,l,u,c,p,d,m=1,g=10,y=e,I=y.d,A=y.constructor,C=A.rounding,w=A.precision;if(y.s<0||!I||!I[0]||!y.e&&I[0]==1&&I.length==1)return new A(I&&!I[0]?-1/0:y.s!=1?NaN:I?0:y);if(t==null?(x=!1,c=w):c=t,A.precision=c+=g,r=J(I),n=r.charAt(0),Math.abs(o=y.e)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)y=y.times(e),r=J(y.d),n=r.charAt(0),m++;o=y.e,n>1?(y=new A("0."+r),o++):y=new A(n+"."+r.slice(1))}else return u=nn(A,c+2,w).times(o+""),y=Le(new A(n+"."+r.slice(1)),c-g).plus(u),A.precision=w,t==null?h(y,w,C,x=!0):y;for(p=y,l=s=y=N(y.minus(1),y.plus(1),c,1),d=h(y.times(y),c,1),i=3;;){if(s=h(s.times(d),c,1),u=l.plus(N(s,new A(i),c,1)),J(u.d).slice(0,c)===J(l.d).slice(0,c))if(l=l.times(2),o!==0&&(l=l.plus(nn(A,c+2,w).times(o+""))),l=N(l,new A(m),c,1),t==null)if(er(l.d,c-g,C,a))A.precision=c+=g,u=s=y=N(p.minus(1),p.plus(1),c,1),d=h(y.times(y),c,1),i=a=1;else return h(l,A.precision=w,C,x=!0);else return A.precision=w,l;l=u,i+=2}}function Ls(e){return String(e.s*e.s/0)}function en(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;n++);for(i=t.length;t.charCodeAt(i-1)===48;--i);if(t=t.slice(n,i),t){if(i-=n,e.e=r=r-n-1,e.d=[],n=(r+1)%E,r<0&&(n+=E),n<i){for(n&&e.d.push(+t.slice(0,n)),i-=E;n<i;)e.d.push(+t.slice(n,n+=E));t=t.slice(n),n=E-t.length}else n-=i;for(;n--;)t+="0";e.d.push(+t),x&&(e.e>e.constructor.maxE?(e.d=null,e.e=NaN):e.e<e.constructor.minE&&(e.e=0,e.d=[0]))}else e.e=0,e.d=[0];return e}function Pp(e,t){var r,n,i,o,s,a,l,u,c;if(t.indexOf("_")>-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),_s.test(t))return en(e,t)}else if(t==="Infinity"||t==="NaN")return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(hp.test(t))r=16,t=t.toLowerCase();else if(yp.test(t))r=2;else if(wp.test(t))r=8;else throw Error($e+t);for(o=t.search(/p/i),o>0?(l=+t.slice(o+1),t=t.substring(2,o)):t=t.slice(2),o=t.indexOf("."),s=o>=0,n=e.constructor,s&&(t=t.replace(".",""),a=t.length,o=a-o,i=Ms(n,new n(r),o,o*2)),u=Xr(t,r,ge),c=u.length-1,o=c;u[o]===0;--o)u.pop();return o<0?new n(e.s*0):(e.e=sn(u,c),e.d=u,x=!1,s&&(e=N(e,i,a*4)),l&&(e=e.times(Math.abs(l)<54?H(2,l):Ye.pow(2,l))),x=!0,e)}function vp(e,t){var r,n=t.d.length;if(n<3)return t.isZero()?t:gt(e,2,t,t);r=1.4*Math.sqrt(n),r=r>16?16:r|0,t=t.times(1/an(5,r)),t=gt(e,2,t,t);for(var i,o=new e(5),s=new e(16),a=new e(20);r--;)i=t.times(t),t=t.times(o.plus(i.times(s.times(i).minus(a))));return t}function gt(e,t,r,n,i){var o,s,a,l,u=1,c=e.precision,p=Math.ceil(c/E);for(x=!1,l=r.times(r),a=new e(n);;){if(s=N(a.times(l),new e(t++*t++),c,1),a=i?n.plus(s):n.minus(s),n=N(s.times(l),new e(t++*t++),c,1),s=a.plus(n),s.d[p]!==void 0){for(o=p;s.d[o]===a.d[o]&&o--;);if(o==-1)break}o=a,a=n,n=s,s=o,u++}return x=!0,s.d.length=p+1,s}function an(e,t){for(var r=e;--t;)r*=e;return r}function $s(e,t){var r,n=t.s<0,i=Ee(e,e.precision,1),o=i.times(.5);if(t=t.abs(),t.lte(o))return Oe=n?4:1,t;if(r=t.divToInt(i),r.isZero())Oe=n?3:2;else{if(t=t.minus(r.times(i)),t.lte(o))return Oe=Cs(r)?n?2:3:n?4:1,t;Oe=Cs(r)?n?1:4:n?3:2}return t.minus(i).abs()}function Ci(e,t,r,n){var i,o,s,a,l,u,c,p,d,m=e.constructor,g=r!==void 0;if(g?(ae(r,1,Ve),n===void 0?n=m.rounding:ae(n,0,8)):(r=m.precision,n=m.rounding),!e.isFinite())c=Ls(e);else{for(c=xe(e),s=c.indexOf("."),g?(i=2,t==16?r=r*4-3:t==8&&(r=r*3-2)):i=t,s>=0&&(c=c.replace(".",""),d=new m(1),d.e=c.length-s,d.d=Xr(xe(d),10,i),d.e=d.d.length),p=Xr(c,10,i),o=l=p.length;p[--l]==0;)p.pop();if(!p[0])c=g?"0p+0":"0";else{if(s<0?o--:(e=new m(e),e.d=p,e.e=o,e=N(e,d,r,n,0,i),p=e.d,o=e.e,u=Is),s=p[r],a=i/2,u=u||p[r+1]!==void 0,u=n<4?(s!==void 0||u)&&(n===0||n===(e.s<0?3:2)):s>a||s===a&&(n===4||u||n===6&&p[r-1]&1||n===(e.s<0?8:7)),p.length=r,u)for(;++p[--r]>i-1;)p[r]=0,r||(++o,p.unshift(1));for(l=p.length;!p[l-1];--l);for(s=0,c="";s<l;s++)c+=Pi.charAt(p[s]);if(g){if(l>1)if(t==16||t==8){for(s=t==16?4:3,--l;l%s;l++)c+="0";for(p=Xr(c,i,t),l=p.length;!p[l-1];--l);for(s=1,c="1.";s<l;s++)c+=Pi.charAt(p[s])}else c=c.charAt(0)+"."+c.slice(1);c=c+(o<0?"p":"p+")+o}else if(o<0){for(;++o;)c="0"+c;c="0."+c}else if(++o>l)for(o-=l;o--;)c+="0";else o<l&&(c=c.slice(0,o)+"."+c.slice(o))}c=(t==16?"0x":t==2?"0b":t==8?"0o":"")+c}return e.s<0?"-"+c:c}function Ss(e,t){if(e.length>t)return e.length=t,!0}function Tp(e){return new this(e).abs()}function Ap(e){return new this(e).acos()}function Cp(e){return new this(e).acosh()}function Sp(e,t){return new this(e).plus(t)}function Rp(e){return new this(e).asin()}function Ip(e){return new this(e).asinh()}function kp(e){return new this(e).atan()}function Op(e){return new this(e).atanh()}function Dp(e,t){e=new this(e),t=new this(t);var r,n=this.precision,i=this.rounding,o=n+4;return!e.s||!t.s?r=new this(NaN):!e.d&&!t.d?(r=Ee(this,o,1).times(t.s>0?.25:.75),r.s=e.s):!t.d||e.isZero()?(r=t.s<0?Ee(this,n,i):new this(0),r.s=e.s):!e.d||t.isZero()?(r=Ee(this,o,1).times(.5),r.s=e.s):t.s<0?(this.precision=o,this.rounding=1,r=this.atan(N(e,t,o,1)),t=Ee(this,o,1),this.precision=n,this.rounding=i,r=e.s<0?r.minus(t):r.plus(t)):r=this.atan(N(e,t,o,1)),r}function _p(e){return new this(e).cbrt()}function Np(e){return h(e=new this(e),e.e+1,2)}function Mp(e,t,r){return new this(e).clamp(t,r)}function Fp(e){if(!e||typeof e!="object")throw Error(on+"Object expected");var t,r,n,i=e.defaults===!0,o=["precision",1,Ve,"rounding",0,8,"toExpNeg",-ft,0,"toExpPos",0,ft,"maxE",0,ft,"minE",-ft,0,"modulo",0,9];for(t=0;t<o.length;t+=3)if(r=o[t],i&&(this[r]=vi[r]),(n=e[r])!==void 0)if(te(n)===n&&n>=o[t+1]&&n<=o[t+2])this[r]=n;else throw Error($e+r+": "+n);if(r="crypto",i&&(this[r]=vi[r]),(n=e[r])!==void 0)if(n===!0||n===!1||n===0||n===1)if(n)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[r]=!0;else throw Error(Os);else this[r]=!1;else throw Error($e+r+": "+n);return this}function Lp(e){return new this(e).cos()}function $p(e){return new this(e).cosh()}function Vs(e){var t,r,n;function i(o){var s,a,l,u=this;if(!(u instanceof i))return new i(o);if(u.constructor=i,Rs(o)){u.s=o.s,x?!o.d||o.e>i.maxE?(u.e=NaN,u.d=null):o.e<i.minE?(u.e=0,u.d=[0]):(u.e=o.e,u.d=o.d.slice()):(u.e=o.e,u.d=o.d?o.d.slice():o.d);return}if(l=typeof o,l==="number"){if(o===0){u.s=1/o<0?-1:1,u.e=0,u.d=[0];return}if(o<0?(o=-o,u.s=-1):u.s=1,o===~~o&&o<1e7){for(s=0,a=o;a>=10;a/=10)s++;x?s>i.maxE?(u.e=NaN,u.d=null):s<i.minE?(u.e=0,u.d=[0]):(u.e=s,u.d=[o]):(u.e=s,u.d=[o]);return}if(o*0!==0){o||(u.s=NaN),u.e=NaN,u.d=null;return}return en(u,o.toString())}if(l==="string")return(a=o.charCodeAt(0))===45?(o=o.slice(1),u.s=-1):(a===43&&(o=o.slice(1)),u.s=1),_s.test(o)?en(u,o):Pp(u,o);if(l==="bigint")return o<0?(o=-o,u.s=-1):u.s=1,en(u,o.toString());throw Error($e+o)}if(i.prototype=f,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.EUCLID=9,i.config=i.set=Fp,i.clone=Vs,i.isDecimal=Rs,i.abs=Tp,i.acos=Ap,i.acosh=Cp,i.add=Sp,i.asin=Rp,i.asinh=Ip,i.atan=kp,i.atanh=Op,i.atan2=Dp,i.cbrt=_p,i.ceil=Np,i.clamp=Mp,i.cos=Lp,i.cosh=$p,i.div=Vp,i.exp=qp,i.floor=Up,i.hypot=jp,i.ln=Bp,i.log=Qp,i.log10=Gp,i.log2=Hp,i.max=Wp,i.min=Jp,i.mod=Kp,i.mul=zp,i.pow=Yp,i.random=Zp,i.round=Xp,i.sign=ed,i.sin=td,i.sinh=rd,i.sqrt=nd,i.sub=id,i.sum=od,i.tan=sd,i.tanh=ad,i.trunc=ld,e===void 0&&(e={}),e&&e.defaults!==!0)for(n=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],t=0;t<n.length;)e.hasOwnProperty(r=n[t++])||(e[r]=this[r]);return i.config(e),i}function Vp(e,t){return new this(e).div(t)}function qp(e){return new this(e).exp()}function Up(e){return h(e=new this(e),e.e+1,3)}function jp(){var e,t,r=new this(0);for(x=!1,e=0;e<arguments.length;)if(t=new this(arguments[e++]),t.d)r.d&&(r=r.plus(t.times(t)));else{if(t.s)return x=!0,new this(1/0);r=t}return x=!0,r.sqrt()}function Rs(e){return e instanceof Ye||e&&e.toStringTag===Ds||!1}function Bp(e){return new this(e).ln()}function Qp(e,t){return new this(e).log(t)}function Hp(e){return new this(e).log(2)}function Gp(e){return new this(e).log(10)}function Wp(){return Fs(this,arguments,-1)}function Jp(){return Fs(this,arguments,1)}function Kp(e,t){return new this(e).mod(t)}function zp(e,t){return new this(e).mul(t)}function Yp(e,t){return new this(e).pow(t)}function Zp(e){var t,r,n,i,o=0,s=new this(1),a=[];if(e===void 0?e=this.precision:ae(e,1,Ve),n=Math.ceil(e/E),this.crypto)if(crypto.getRandomValues)for(t=crypto.getRandomValues(new Uint32Array(n));o<n;)i=t[o],i>=429e7?t[o]=crypto.getRandomValues(new Uint32Array(1))[0]:a[o++]=i%1e7;else if(crypto.randomBytes){for(t=crypto.randomBytes(n*=4);o<n;)i=t[o]+(t[o+1]<<8)+(t[o+2]<<16)+((t[o+3]&127)<<24),i>=214e7?crypto.randomBytes(4).copy(t,o):(a.push(i%1e7),o+=4);o=n/4}else throw Error(Os);else for(;o<n;)a[o++]=Math.random()*1e7|0;for(n=a[--o],e%=E,n&&e&&(i=H(10,E-e),a[o]=(n/i|0)*i);a[o]===0;o--)a.pop();if(o<0)r=0,a=[0];else{for(r=-1;a[0]===0;r-=E)a.shift();for(n=1,i=a[0];i>=10;i/=10)n++;n<E&&(r-=E-n)}return s.e=r,s.d=a,s}function Xp(e){return h(e=new this(e),e.e+1,this.rounding)}function ed(e){return e=new this(e),e.d?e.d[0]?e.s:0*e.s:e.s||NaN}function td(e){return new this(e).sin()}function rd(e){return new this(e).sinh()}function nd(e){return new this(e).sqrt()}function id(e,t){return new this(e).sub(t)}function od(){var e=0,t=arguments,r=new this(t[e]);for(x=!1;r.s&&++e<t.length;)r=r.plus(t[e]);return x=!0,h(r,this.precision,this.rounding)}function sd(e){return new this(e).tan()}function ad(e){return new this(e).tanh()}function ld(e){return h(e=new this(e),e.e+1,1)}f[Symbol.for("nodejs.util.inspect.custom")]=f.toString;f[Symbol.toStringTag]="Decimal";var Ye=f.constructor=Vs(vi);tn=new Ye(tn);rn=new Ye(rn);var K=Ye;function qe(e){return e===null?e:Array.isArray(e)?e.map(qe):typeof e=="object"?ud(e)?cd(e):e.constructor!==null&&e.constructor.name!=="Object"?e:mt(e,qe):e}function ud(e){return e!==null&&typeof e=="object"&&typeof e.$type=="string"}function cd({$type:e,value:t}){switch(e){case"BigInt":return BigInt(t);case"Bytes":{let{buffer:r,byteOffset:n,byteLength:i}=Buffer.from(t,"base64");return new Uint8Array(r,n,i)}case"DateTime":return new Date(t);case"Decimal":return new K(t);case"Json":return JSON.parse(t);default:fe(t,"Unknown tagged value")}}var be=class{_map=new Map;get(t){return this._map.get(t)?.value}set(t,r){this._map.set(t,{value:r})}getOrCreate(t,r){let n=this._map.get(t);if(n)return n.value;let i=r();return this.set(t,i),i}};function Ue(e){return e.substring(0,1).toLowerCase()+e.substring(1)}function qs(e,t){let r={};for(let n of e){let i=n[t];r[i]=n}return r}function tr(e){let t;return{get(){return t||(t={value:e()}),t.value}}}function Us(e){return{models:Si(e.models),enums:Si(e.enums),types:Si(e.types)}}function Si(e){let t={};for(let{name:r,...n}of e)t[r]=n;return t}function yt(e){return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}function ln(e){return e.toString()!=="Invalid Date"}function ht(e){return Ye.isDecimal(e)?!0:e!==null&&typeof e=="object"&&typeof e.s=="number"&&typeof e.e=="number"&&typeof e.toFixed=="function"&&Array.isArray(e.d)}var rr={};ct(rr,{ModelAction:()=>wt,datamodelEnumToSchemaEnum:()=>pd});function pd(e){return{name:e.name,values:e.values.map(t=>t.name)}}var wt=(w=>(w.findUnique="findUnique",w.findUniqueOrThrow="findUniqueOrThrow",w.findFirst="findFirst",w.findFirstOrThrow="findFirstOrThrow",w.findMany="findMany",w.create="create",w.createMany="createMany",w.createManyAndReturn="createManyAndReturn",w.update="update",w.updateMany="updateMany",w.updateManyAndReturn="updateManyAndReturn",w.upsert="upsert",w.delete="delete",w.deleteMany="deleteMany",w.groupBy="groupBy",w.count="count",w.aggregate="aggregate",w.findRaw="findRaw",w.aggregateRaw="aggregateRaw",w))(wt||{});var Gs=j(us());var Hs=j(require("node:fs"));var js={keyword:Ie,entity:Ie,value:e=>re(ze(e)),punctuation:ze,directive:Ie,function:Ie,variable:e=>re(ze(e)),string:e=>re(Qt(e)),boolean:Ke,number:Ie,comment:Ht};var dd=e=>e,un={},md=0,v={manual:un.Prism&&un.Prism.manual,disableWorkerMessageHandler:un.Prism&&un.Prism.disableWorkerMessageHandler,util:{encode:function(e){if(e instanceof ye){let t=e;return new ye(t.type,v.util.encode(t.content),t.alias)}else return Array.isArray(e)?e.map(v.util.encode):e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++md}),e.__id},clone:function e(t,r){let n,i,o=v.util.type(t);switch(r=r||{},o){case"Object":if(i=v.util.objId(t),r[i])return r[i];n={},r[i]=n;for(let s in t)t.hasOwnProperty(s)&&(n[s]=e(t[s],r));return n;case"Array":return i=v.util.objId(t),r[i]?r[i]:(n=[],r[i]=n,t.forEach(function(s,a){n[a]=e(s,r)}),n);default:return t}}},languages:{extend:function(e,t){let r=v.util.clone(v.languages[e]);for(let n in t)r[n]=t[n];return r},insertBefore:function(e,t,r,n){n=n||v.languages;let i=n[e],o={};for(let a in i)if(i.hasOwnProperty(a)){if(a==t)for(let l in r)r.hasOwnProperty(l)&&(o[l]=r[l]);r.hasOwnProperty(a)||(o[a]=i[a])}let s=n[e];return n[e]=o,v.languages.DFS(v.languages,function(a,l){l===s&&a!=e&&(this[a]=o)}),o},DFS:function e(t,r,n,i){i=i||{};let o=v.util.objId;for(let s in t)if(t.hasOwnProperty(s)){r.call(t,s,t[s],n||s);let a=t[s],l=v.util.type(a);l==="Object"&&!i[o(a)]?(i[o(a)]=!0,e(a,r,null,i)):l==="Array"&&!i[o(a)]&&(i[o(a)]=!0,e(a,r,s,i))}}},plugins:{},highlight:function(e,t,r){let n={code:e,grammar:t,language:r};return v.hooks.run("before-tokenize",n),n.tokens=v.tokenize(n.code,n.grammar),v.hooks.run("after-tokenize",n),ye.stringify(v.util.encode(n.tokens),n.language)},matchGrammar:function(e,t,r,n,i,o,s){for(let y in r){if(!r.hasOwnProperty(y)||!r[y])continue;if(y==s)return;let I=r[y];I=v.util.type(I)==="Array"?I:[I];for(let A=0;A<I.length;++A){let C=I[A],w=C.inside,O=!!C.lookbehind,me=!!C.greedy,ce=0,Bt=C.alias;if(me&&!C.pattern.global){let U=C.pattern.toString().match(/[imuy]*$/)[0];C.pattern=RegExp(C.pattern.source,U+"g")}C=C.pattern||C;for(let U=n,oe=i;U<t.length;oe+=t[U].length,++U){let Se=t[U];if(t.length>e.length)return;if(Se instanceof ye)continue;if(me&&U!=t.length-1){C.lastIndex=oe;var p=C.exec(e);if(!p)break;var c=p.index+(O?p[1].length:0),d=p.index+p[0].length,a=U,l=oe;for(let _=t.length;a<_&&(l<d||!t[a].type&&!t[a-1].greedy);++a)l+=t[a].length,c>=l&&(++U,oe=l);if(t[U]instanceof ye)continue;u=a-U,Se=e.slice(oe,l),p.index-=oe}else{C.lastIndex=0;var p=C.exec(Se),u=1}if(!p){if(o)break;continue}O&&(ce=p[1]?p[1].length:0);var c=p.index+ce,p=p[0].slice(ce),d=c+p.length,m=Se.slice(0,c),g=Se.slice(d);let Y=[U,u];m&&(++U,oe+=m.length,Y.push(m));let ut=new ye(y,w?v.tokenize(p,w):p,Bt,p,me);if(Y.push(ut),g&&Y.push(g),Array.prototype.splice.apply(t,Y),u!=1&&v.matchGrammar(e,t,r,U,oe,!0,y),o)break}}}},tokenize:function(e,t){let r=[e],n=t.rest;if(n){for(let i in n)t[i]=n[i];delete t.rest}return v.matchGrammar(e,r,t,0,0,!1),r},hooks:{all:{},add:function(e,t){let r=v.hooks.all;r[e]=r[e]||[],r[e].push(t)},run:function(e,t){let r=v.hooks.all[e];if(!(!r||!r.length))for(var n=0,i;i=r[n++];)i(t)}},Token:ye};v.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/((?:\b(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,boolean:/\b(?:true|false)\b/,function:/\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&?|\|\|?|\?|\*|\/|~|\^|%/,punctuation:/[{}[\];(),.:]/};v.languages.javascript=v.languages.extend("clike",{"class-name":[v.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])[_$A-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\.(?:prototype|constructor))/,lookbehind:!0}],keyword:[{pattern:/((?:^|})\s*)(?:catch|finally)\b/,lookbehind:!0},{pattern:/(^|[^.])\b(?:as|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],number:/\b(?:(?:0[xX](?:[\dA-Fa-f](?:_[\dA-Fa-f])?)+|0[bB](?:[01](?:_[01])?)+|0[oO](?:[0-7](?:_[0-7])?)+)n?|(?:\d(?:_\d)?)+n|NaN|Infinity)\b|(?:\b(?:\d(?:_\d)?)+\.?(?:\d(?:_\d)?)*|\B\.(?:\d(?:_\d)?)+)(?:[Ee][+-]?(?:\d(?:_\d)?)+)?/,function:/[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,operator:/-[-=]?|\+[+=]?|!=?=?|<<?=?|>>?>?=?|=(?:==?|>)?|&[&=]?|\|[|=]?|\*\*?=?|\/=?|~|\^=?|%=?|\?|\.{3}/});v.languages.javascript["class-name"][0].pattern=/(\b(?:class|interface|extends|implements|instanceof|new)\s+)[\w.\\]+/;v.languages.insertBefore("javascript","keyword",{regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s])\s*)\/(\[(?:[^\]\\\r\n]|\\.)*]|\\.|[^/\\\[\r\n])+\/[gimyus]{0,6}(?=\s*($|[\r\n,.;})\]]))/,lookbehind:!0,greedy:!0},"function-variable":{pattern:/[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)?\s*\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\))/,lookbehind:!0,inside:v.languages.javascript},{pattern:/[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*=>)/i,inside:v.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*=>)/,lookbehind:!0,inside:v.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*\s*)\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*\{)/,lookbehind:!0,inside:v.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/});v.languages.markup&&v.languages.markup.tag.addInlined("script","javascript");v.languages.js=v.languages.javascript;v.languages.typescript=v.languages.extend("javascript",{keyword:/\b(?:abstract|as|async|await|break|case|catch|class|const|constructor|continue|debugger|declare|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|is|keyof|let|module|namespace|new|null|of|package|private|protected|public|readonly|return|require|set|static|super|switch|this|throw|try|type|typeof|var|void|while|with|yield)\b/,builtin:/\b(?:string|Function|any|number|boolean|Array|symbol|console|Promise|unknown|never)\b/});v.languages.ts=v.languages.typescript;function ye(e,t,r,n,i){this.type=e,this.content=t,this.alias=r,this.length=(n||"").length|0,this.greedy=!!i}ye.stringify=function(e,t){return typeof e=="string"?e:Array.isArray(e)?e.map(function(r){return ye.stringify(r,t)}).join(""):fd(e.type)(e.content)};function fd(e){return js[e]||dd}function Bs(e){return gd(e,v.languages.javascript)}function gd(e,t){return v.tokenize(e,t).map(n=>ye.stringify(n)).join("")}function Qs(e){return pi(e)}var cn=class e{firstLineNumber;lines;static read(t){let r;try{r=Hs.default.readFileSync(t,"utf-8")}catch{return null}return e.fromContent(r)}static fromContent(t){let r=t.split(/\r?\n/);return new e(1,r)}constructor(t,r){this.firstLineNumber=t,this.lines=r}get lastLineNumber(){return this.firstLineNumber+this.lines.length-1}mapLineAt(t,r){if(t<this.firstLineNumber||t>this.lines.length+this.firstLineNumber)return this;let n=t-this.firstLineNumber,i=[...this.lines];return i[n]=r(i[n]),new e(this.firstLineNumber,i)}mapLines(t){return new e(this.firstLineNumber,this.lines.map((r,n)=>t(r,this.firstLineNumber+n)))}lineAt(t){return this.lines[t-this.firstLineNumber]}prependSymbolAt(t,r){return this.mapLines((n,i)=>i===t?`${r} ${n}`:` ${n}`)}slice(t,r){let n=this.lines.slice(t-1,r).join(`
13
+ `;console.warn(`${Ke("warn(prisma)")} ${u}`)}}}}function bs(e){if(fp(e)){wi(`Environment variables loaded from ${e}`);let t=Ei.default.config({path:e,debug:process.env.DOTENV_CONFIG_DEBUG?!0:void 0});return{dotenvResult:xs(t),message:Je(`Environment variables loaded from ${dt.default.relative(process.cwd(),e)}`),path:e}}else wi(`Environment variables not found at ${e}`);return null}function Ps(e,t){return e&&t&&dt.default.resolve(e)===dt.default.resolve(t)}function fp(e){return!!(e&&Yr.default.existsSync(e))}function xi(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function mt(e,t){let r={};for(let n of Object.keys(e))r[n]=t(e[n],n);return r}function bi(e,t){if(e.length===0)return;let r=e[0];for(let n=1;n<e.length;n++)t(r,e[n])<0&&(r=e[n]);return r}function b(e,t){Object.defineProperty(e,"name",{value:t,configurable:!0})}var Ts=new Set,Xt=(e,t,...r)=>{Ts.has(e)||(Ts.add(e),mi(t,...r))};var k=class e extends Error{clientVersion;errorCode;retryable;constructor(t,r,n){super(t),this.name="PrismaClientInitializationError",this.clientVersion=r,this.errorCode=n,Error.captureStackTrace(e)}get[Symbol.toStringTag](){return"PrismaClientInitializationError"}};b(k,"PrismaClientInitializationError");var Q=class extends Error{code;meta;clientVersion;batchRequestIdx;constructor(t,{code:r,clientVersion:n,meta:i,batchRequestIdx:o}){super(t),this.name="PrismaClientKnownRequestError",this.code=r,this.clientVersion=n,this.meta=i,Object.defineProperty(this,"batchRequestIdx",{value:o,enumerable:!1,writable:!0})}get[Symbol.toStringTag](){return"PrismaClientKnownRequestError"}};b(Q,"PrismaClientKnownRequestError");var ne=class extends Error{clientVersion;constructor(t,r){super(t),this.name="PrismaClientRustPanicError",this.clientVersion=r}get[Symbol.toStringTag](){return"PrismaClientRustPanicError"}};b(ne,"PrismaClientRustPanicError");var X=class extends Error{clientVersion;batchRequestIdx;constructor(t,{clientVersion:r,batchRequestIdx:n}){super(t),this.name="PrismaClientUnknownRequestError",this.clientVersion=r,Object.defineProperty(this,"batchRequestIdx",{value:n,writable:!0,enumerable:!1})}get[Symbol.toStringTag](){return"PrismaClientUnknownRequestError"}};b(X,"PrismaClientUnknownRequestError");var ee=class extends Error{name="PrismaClientValidationError";clientVersion;constructor(t,{clientVersion:r}){super(t),this.clientVersion=r}get[Symbol.toStringTag](){return"PrismaClientValidationError"}};b(ee,"PrismaClientValidationError");var ft=9e15,Ve=1e9,Pi="0123456789abcdef",tn="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",rn="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",vi={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-ft,maxE:ft,crypto:!1},Is,Oe,x=!0,on="[DecimalError] ",$e=on+"Invalid argument: ",ks=on+"Precision limit exceeded",Os=on+"crypto unavailable",Ds="[object Decimal]",te=Math.floor,H=Math.pow,gp=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,hp=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,yp=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,_s=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,ge=1e7,E=7,wp=9007199254740991,Ep=tn.length-1,Ti=rn.length-1,m={toStringTag:Ds};m.absoluteValue=m.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),y(e)};m.ceil=function(){return y(new this.constructor(this),this.e+1,2)};m.clampedTo=m.clamp=function(e,t){var r,n=this,i=n.constructor;if(e=new i(e),t=new i(t),!e.s||!t.s)return new i(NaN);if(e.gt(t))throw Error($e+t);return r=n.cmp(e),r<0?e:n.cmp(t)>0?t:new i(n)};m.comparedTo=m.cmp=function(e){var t,r,n,i,o=this,s=o.d,a=(e=new o.constructor(e)).d,l=o.s,u=e.s;if(!s||!a)return!l||!u?NaN:l!==u?l:s===a?0:!s^l<0?1:-1;if(!s[0]||!a[0])return s[0]?l:a[0]?-u:0;if(l!==u)return l;if(o.e!==e.e)return o.e>e.e^l<0?1:-1;for(n=s.length,i=a.length,t=0,r=n<i?n:i;t<r;++t)if(s[t]!==a[t])return s[t]>a[t]^l<0?1:-1;return n===i?0:n>i^l<0?1:-1};m.cosine=m.cos=function(){var e,t,r=this,n=r.constructor;return r.d?r.d[0]?(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+E,n.rounding=1,r=xp(n,$s(n,r)),n.precision=e,n.rounding=t,y(Oe==2||Oe==3?r.neg():r,e,t,!0)):new n(1):new n(NaN)};m.cubeRoot=m.cbrt=function(){var e,t,r,n,i,o,s,a,l,u,c=this,p=c.constructor;if(!c.isFinite()||c.isZero())return new p(c);for(x=!1,o=c.s*H(c.s*c,1/3),!o||Math.abs(o)==1/0?(r=J(c.d),e=c.e,(o=(e-r.length+1)%3)&&(r+=o==1||o==-2?"0":"00"),o=H(r,1/3),e=te((e+1)/3)-(e%3==(e<0?-1:2)),o==1/0?r="5e"+e:(r=o.toExponential(),r=r.slice(0,r.indexOf("e")+1)+e),n=new p(r),n.s=c.s):n=new p(o.toString()),s=(e=p.precision)+3;;)if(a=n,l=a.times(a).times(a),u=l.plus(c),n=N(u.plus(c).times(a),u.plus(l),s+2,1),J(a.d).slice(0,s)===(r=J(n.d)).slice(0,s))if(r=r.slice(s-3,s+1),r=="9999"||!i&&r=="4999"){if(!i&&(y(a,e+1,0),a.times(a).times(a).eq(c))){n=a;break}s+=4,i=1}else{(!+r||!+r.slice(1)&&r.charAt(0)=="5")&&(y(n,e+1,1),t=!n.times(n).times(n).eq(c));break}return x=!0,y(n,e,p.rounding,t)};m.decimalPlaces=m.dp=function(){var e,t=this.d,r=NaN;if(t){if(e=t.length-1,r=(e-te(this.e/E))*E,e=t[e],e)for(;e%10==0;e/=10)r--;r<0&&(r=0)}return r};m.dividedBy=m.div=function(e){return N(this,new this.constructor(e))};m.dividedToIntegerBy=m.divToInt=function(e){var t=this,r=t.constructor;return y(N(t,new r(e),0,1,1),r.precision,r.rounding)};m.equals=m.eq=function(e){return this.cmp(e)===0};m.floor=function(){return y(new this.constructor(this),this.e+1,3)};m.greaterThan=m.gt=function(e){return this.cmp(e)>0};m.greaterThanOrEqualTo=m.gte=function(e){var t=this.cmp(e);return t==1||t===0};m.hyperbolicCosine=m.cosh=function(){var e,t,r,n,i,o=this,s=o.constructor,a=new s(1);if(!o.isFinite())return new s(o.s?1/0:NaN);if(o.isZero())return a;r=s.precision,n=s.rounding,s.precision=r+Math.max(o.e,o.sd())+4,s.rounding=1,i=o.d.length,i<32?(e=Math.ceil(i/3),t=(1/an(4,e)).toString()):(e=16,t="2.3283064365386962890625e-10"),o=gt(s,1,o.times(t),new s(1),!0);for(var l,u=e,c=new s(8);u--;)l=o.times(o),o=a.minus(l.times(c.minus(l.times(c))));return y(o,s.precision=r,s.rounding=n,!0)};m.hyperbolicSine=m.sinh=function(){var e,t,r,n,i=this,o=i.constructor;if(!i.isFinite()||i.isZero())return new o(i);if(t=o.precision,r=o.rounding,o.precision=t+Math.max(i.e,i.sd())+4,o.rounding=1,n=i.d.length,n<3)i=gt(o,2,i,i,!0);else{e=1.4*Math.sqrt(n),e=e>16?16:e|0,i=i.times(1/an(5,e)),i=gt(o,2,i,i,!0);for(var s,a=new o(5),l=new o(16),u=new o(20);e--;)s=i.times(i),i=i.times(a.plus(s.times(l.times(s).plus(u))))}return o.precision=t,o.rounding=r,y(i,t,r,!0)};m.hyperbolicTangent=m.tanh=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+7,n.rounding=1,N(r.sinh(),r.cosh(),n.precision=e,n.rounding=t)):new n(r.s)};m.inverseCosine=m.acos=function(){var e=this,t=e.constructor,r=e.abs().cmp(1),n=t.precision,i=t.rounding;return r!==-1?r===0?e.isNeg()?Ee(t,n,i):new t(0):new t(NaN):e.isZero()?Ee(t,n+4,i).times(.5):(t.precision=n+6,t.rounding=1,e=new t(1).minus(e).div(e.plus(1)).sqrt().atan(),t.precision=n,t.rounding=i,e.times(2))};m.inverseHyperbolicCosine=m.acosh=function(){var e,t,r=this,n=r.constructor;return r.lte(1)?new n(r.eq(1)?0:NaN):r.isFinite()?(e=n.precision,t=n.rounding,n.precision=e+Math.max(Math.abs(r.e),r.sd())+4,n.rounding=1,x=!1,r=r.times(r).minus(1).sqrt().plus(r),x=!0,n.precision=e,n.rounding=t,r.ln()):new n(r)};m.inverseHyperbolicSine=m.asinh=function(){var e,t,r=this,n=r.constructor;return!r.isFinite()||r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+2*Math.max(Math.abs(r.e),r.sd())+6,n.rounding=1,x=!1,r=r.times(r).plus(1).sqrt().plus(r),x=!0,n.precision=e,n.rounding=t,r.ln())};m.inverseHyperbolicTangent=m.atanh=function(){var e,t,r,n,i=this,o=i.constructor;return i.isFinite()?i.e>=0?new o(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(e=o.precision,t=o.rounding,n=i.sd(),Math.max(n,e)<2*-i.e-1?y(new o(i),e,t,!0):(o.precision=r=n-i.e,i=N(i.plus(1),new o(1).minus(i),r+e,1),o.precision=e+4,o.rounding=1,i=i.ln(),o.precision=e,o.rounding=t,i.times(.5))):new o(NaN)};m.inverseSine=m.asin=function(){var e,t,r,n,i=this,o=i.constructor;return i.isZero()?new o(i):(t=i.abs().cmp(1),r=o.precision,n=o.rounding,t!==-1?t===0?(e=Ee(o,r+4,n).times(.5),e.s=i.s,e):new o(NaN):(o.precision=r+6,o.rounding=1,i=i.div(new o(1).minus(i.times(i)).sqrt().plus(1)).atan(),o.precision=r,o.rounding=n,i.times(2)))};m.inverseTangent=m.atan=function(){var e,t,r,n,i,o,s,a,l,u=this,c=u.constructor,p=c.precision,d=c.rounding;if(u.isFinite()){if(u.isZero())return new c(u);if(u.abs().eq(1)&&p+4<=Ti)return s=Ee(c,p+4,d).times(.25),s.s=u.s,s}else{if(!u.s)return new c(NaN);if(p+4<=Ti)return s=Ee(c,p+4,d).times(.5),s.s=u.s,s}for(c.precision=a=p+10,c.rounding=1,r=Math.min(28,a/E+2|0),e=r;e;--e)u=u.div(u.times(u).plus(1).sqrt().plus(1));for(x=!1,t=Math.ceil(a/E),n=1,l=u.times(u),s=new c(u),i=u;e!==-1;)if(i=i.times(l),o=s.minus(i.div(n+=2)),i=i.times(l),s=o.plus(i.div(n+=2)),s.d[t]!==void 0)for(e=t;s.d[e]===o.d[e]&&e--;);return r&&(s=s.times(2<<r-1)),x=!0,y(s,c.precision=p,c.rounding=d,!0)};m.isFinite=function(){return!!this.d};m.isInteger=m.isInt=function(){return!!this.d&&te(this.e/E)>this.d.length-2};m.isNaN=function(){return!this.s};m.isNegative=m.isNeg=function(){return this.s<0};m.isPositive=m.isPos=function(){return this.s>0};m.isZero=function(){return!!this.d&&this.d[0]===0};m.lessThan=m.lt=function(e){return this.cmp(e)<0};m.lessThanOrEqualTo=m.lte=function(e){return this.cmp(e)<1};m.logarithm=m.log=function(e){var t,r,n,i,o,s,a,l,u=this,c=u.constructor,p=c.precision,d=c.rounding,f=5;if(e==null)e=new c(10),t=!0;else{if(e=new c(e),r=e.d,e.s<0||!r||!r[0]||e.eq(1))return new c(NaN);t=e.eq(10)}if(r=u.d,u.s<0||!r||!r[0]||u.eq(1))return new c(r&&!r[0]?-1/0:u.s!=1?NaN:r?0:1/0);if(t)if(r.length>1)o=!0;else{for(i=r[0];i%10===0;)i/=10;o=i!==1}if(x=!1,a=p+f,s=Le(u,a),n=t?nn(c,a+10):Le(e,a),l=N(s,n,a,1),er(l.d,i=p,d))do if(a+=10,s=Le(u,a),n=t?nn(c,a+10):Le(e,a),l=N(s,n,a,1),!o){+J(l.d).slice(i+1,i+15)+1==1e14&&(l=y(l,p+1,0));break}while(er(l.d,i+=10,d));return x=!0,y(l,p,d)};m.minus=m.sub=function(e){var t,r,n,i,o,s,a,l,u,c,p,d,f=this,g=f.constructor;if(e=new g(e),!f.d||!e.d)return!f.s||!e.s?e=new g(NaN):f.d?e.s=-e.s:e=new g(e.d||f.s!==e.s?f:NaN),e;if(f.s!=e.s)return e.s=-e.s,f.plus(e);if(u=f.d,d=e.d,a=g.precision,l=g.rounding,!u[0]||!d[0]){if(d[0])e.s=-e.s;else if(u[0])e=new g(f);else return new g(l===3?-0:0);return x?y(e,a,l):e}if(r=te(e.e/E),c=te(f.e/E),u=u.slice(),o=c-r,o){for(p=o<0,p?(t=u,o=-o,s=d.length):(t=d,r=c,s=u.length),n=Math.max(Math.ceil(a/E),s)+2,o>n&&(o=n,t.length=1),t.reverse(),n=o;n--;)t.push(0);t.reverse()}else{for(n=u.length,s=d.length,p=n<s,p&&(s=n),n=0;n<s;n++)if(u[n]!=d[n]){p=u[n]<d[n];break}o=0}for(p&&(t=u,u=d,d=t,e.s=-e.s),s=u.length,n=d.length-s;n>0;--n)u[s++]=0;for(n=d.length;n>o;){if(u[--n]<d[n]){for(i=n;i&&u[--i]===0;)u[i]=ge-1;--u[i],u[n]+=ge}u[n]-=d[n]}for(;u[--s]===0;)u.pop();for(;u[0]===0;u.shift())--r;return u[0]?(e.d=u,e.e=sn(u,r),x?y(e,a,l):e):new g(l===3?-0:0)};m.modulo=m.mod=function(e){var t,r=this,n=r.constructor;return e=new n(e),!r.d||!e.s||e.d&&!e.d[0]?new n(NaN):!e.d||r.d&&!r.d[0]?y(new n(r),n.precision,n.rounding):(x=!1,n.modulo==9?(t=N(r,e.abs(),0,3,1),t.s*=e.s):t=N(r,e,0,n.modulo,1),t=t.times(e),x=!0,r.minus(t))};m.naturalExponential=m.exp=function(){return Ai(this)};m.naturalLogarithm=m.ln=function(){return Le(this)};m.negated=m.neg=function(){var e=new this.constructor(this);return e.s=-e.s,y(e)};m.plus=m.add=function(e){var t,r,n,i,o,s,a,l,u,c,p=this,d=p.constructor;if(e=new d(e),!p.d||!e.d)return!p.s||!e.s?e=new d(NaN):p.d||(e=new d(e.d||p.s===e.s?p:NaN)),e;if(p.s!=e.s)return e.s=-e.s,p.minus(e);if(u=p.d,c=e.d,a=d.precision,l=d.rounding,!u[0]||!c[0])return c[0]||(e=new d(p)),x?y(e,a,l):e;if(o=te(p.e/E),n=te(e.e/E),u=u.slice(),i=o-n,i){for(i<0?(r=u,i=-i,s=c.length):(r=c,n=o,s=u.length),o=Math.ceil(a/E),s=o>s?o+1:s+1,i>s&&(i=s,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for(s=u.length,i=c.length,s-i<0&&(i=s,r=c,c=u,u=r),t=0;i;)t=(u[--i]=u[i]+c[i]+t)/ge|0,u[i]%=ge;for(t&&(u.unshift(t),++n),s=u.length;u[--s]==0;)u.pop();return e.d=u,e.e=sn(u,n),x?y(e,a,l):e};m.precision=m.sd=function(e){var t,r=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error($e+e);return r.d?(t=Ns(r.d),e&&r.e+1>t&&(t=r.e+1)):t=NaN,t};m.round=function(){var e=this,t=e.constructor;return y(new t(e),e.e+1,t.rounding)};m.sine=m.sin=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+E,n.rounding=1,r=Pp(n,$s(n,r)),n.precision=e,n.rounding=t,y(Oe>2?r.neg():r,e,t,!0)):new n(NaN)};m.squareRoot=m.sqrt=function(){var e,t,r,n,i,o,s=this,a=s.d,l=s.e,u=s.s,c=s.constructor;if(u!==1||!a||!a[0])return new c(!u||u<0&&(!a||a[0])?NaN:a?s:1/0);for(x=!1,u=Math.sqrt(+s),u==0||u==1/0?(t=J(a),(t.length+l)%2==0&&(t+="0"),u=Math.sqrt(t),l=te((l+1)/2)-(l<0||l%2),u==1/0?t="5e"+l:(t=u.toExponential(),t=t.slice(0,t.indexOf("e")+1)+l),n=new c(t)):n=new c(u.toString()),r=(l=c.precision)+3;;)if(o=n,n=o.plus(N(s,o,r+2,1)).times(.5),J(o.d).slice(0,r)===(t=J(n.d)).slice(0,r))if(t=t.slice(r-3,r+1),t=="9999"||!i&&t=="4999"){if(!i&&(y(o,l+1,0),o.times(o).eq(s))){n=o;break}r+=4,i=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(y(n,l+1,1),e=!n.times(n).eq(s));break}return x=!0,y(n,l,c.rounding,e)};m.tangent=m.tan=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+10,n.rounding=1,r=r.sin(),r.s=1,r=N(r,new n(1).minus(r.times(r)).sqrt(),e+10,0),n.precision=e,n.rounding=t,y(Oe==2||Oe==4?r.neg():r,e,t,!0)):new n(NaN)};m.times=m.mul=function(e){var t,r,n,i,o,s,a,l,u,c=this,p=c.constructor,d=c.d,f=(e=new p(e)).d;if(e.s*=c.s,!d||!d[0]||!f||!f[0])return new p(!e.s||d&&!d[0]&&!f||f&&!f[0]&&!d?NaN:!d||!f?e.s/0:e.s*0);for(r=te(c.e/E)+te(e.e/E),l=d.length,u=f.length,l<u&&(o=d,d=f,f=o,s=l,l=u,u=s),o=[],s=l+u,n=s;n--;)o.push(0);for(n=u;--n>=0;){for(t=0,i=l+n;i>n;)a=o[i]+f[n]*d[i-n-1]+t,o[i--]=a%ge|0,t=a/ge|0;o[i]=(o[i]+t)%ge|0}for(;!o[--s];)o.pop();return t?++r:o.shift(),e.d=o,e.e=sn(o,r),x?y(e,p.precision,p.rounding):e};m.toBinary=function(e,t){return Ci(this,2,e,t)};m.toDecimalPlaces=m.toDP=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(ae(e,0,Ve),t===void 0?t=n.rounding:ae(t,0,8),y(r,e+r.e+1,t))};m.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=xe(n,!0):(ae(e,0,Ve),t===void 0?t=i.rounding:ae(t,0,8),n=y(new i(n),e+1,t),r=xe(n,!0,e+1)),n.isNeg()&&!n.isZero()?"-"+r:r};m.toFixed=function(e,t){var r,n,i=this,o=i.constructor;return e===void 0?r=xe(i):(ae(e,0,Ve),t===void 0?t=o.rounding:ae(t,0,8),n=y(new o(i),e+i.e+1,t),r=xe(n,!1,e+n.e+1)),i.isNeg()&&!i.isZero()?"-"+r:r};m.toFraction=function(e){var t,r,n,i,o,s,a,l,u,c,p,d,f=this,g=f.d,h=f.constructor;if(!g)return new h(f);if(u=r=new h(1),n=l=new h(0),t=new h(n),o=t.e=Ns(g)-f.e-1,s=o%E,t.d[0]=H(10,s<0?E+s:s),e==null)e=o>0?t:u;else{if(a=new h(e),!a.isInt()||a.lt(u))throw Error($e+a);e=a.gt(t)?o>0?t:u:a}for(x=!1,a=new h(J(g)),c=h.precision,h.precision=o=g.length*E*2;p=N(a,t,0,1,1),i=r.plus(p.times(n)),i.cmp(e)!=1;)r=n,n=i,i=u,u=l.plus(p.times(i)),l=i,i=t,t=a.minus(p.times(i)),a=i;return i=N(e.minus(r),n,0,1,1),l=l.plus(i.times(u)),r=r.plus(i.times(n)),l.s=u.s=f.s,d=N(u,n,o,1).minus(f).abs().cmp(N(l,r,o,1).minus(f).abs())<1?[u,n]:[l,r],h.precision=c,x=!0,d};m.toHexadecimal=m.toHex=function(e,t){return Ci(this,16,e,t)};m.toNearest=function(e,t){var r=this,n=r.constructor;if(r=new n(r),e==null){if(!r.d)return r;e=new n(1),t=n.rounding}else{if(e=new n(e),t===void 0?t=n.rounding:ae(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]?(x=!1,r=N(r,e,0,t,1).times(e),x=!0,y(r)):(e.s=r.s,r=e),r};m.toNumber=function(){return+this};m.toOctal=function(e,t){return Ci(this,8,e,t)};m.toPower=m.pow=function(e){var t,r,n,i,o,s,a=this,l=a.constructor,u=+(e=new l(e));if(!a.d||!e.d||!a.d[0]||!e.d[0])return new l(H(+a,u));if(a=new l(a),a.eq(1))return a;if(n=l.precision,o=l.rounding,e.eq(1))return y(a,n,o);if(t=te(e.e/E),t>=e.d.length-1&&(r=u<0?-u:u)<=wp)return i=Ms(l,a,r,n),e.s<0?new l(1).div(i):y(i,n,o);if(s=a.s,s<0){if(t<e.d.length-1)return new l(NaN);if((e.d[t]&1)==0&&(s=1),a.e==0&&a.d[0]==1&&a.d.length==1)return a.s=s,a}return r=H(+a,u),t=r==0||!isFinite(r)?te(u*(Math.log("0."+J(a.d))/Math.LN10+a.e+1)):new l(r+"").e,t>l.maxE+1||t<l.minE-1?new l(t>0?s/0:0):(x=!1,l.rounding=a.s=1,r=Math.min(12,(t+"").length),i=Ai(e.times(Le(a,n+r)),n),i.d&&(i=y(i,n+5,1),er(i.d,n,o)&&(t=n+10,i=y(Ai(e.times(Le(a,t+r)),t),t+5,1),+J(i.d).slice(n+1,n+15)+1==1e14&&(i=y(i,n+1,0)))),i.s=s,x=!0,l.rounding=o,y(i,n,o))};m.toPrecision=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=xe(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(ae(e,1,Ve),t===void 0?t=i.rounding:ae(t,0,8),n=y(new i(n),e,t),r=xe(n,e<=n.e||n.e<=i.toExpNeg,e)),n.isNeg()&&!n.isZero()?"-"+r:r};m.toSignificantDigits=m.toSD=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(ae(e,1,Ve),t===void 0?t=n.rounding:ae(t,0,8)),y(new n(r),e,t)};m.toString=function(){var e=this,t=e.constructor,r=xe(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+r:r};m.truncated=m.trunc=function(){return y(new this.constructor(this),this.e+1,1)};m.valueOf=m.toJSON=function(){var e=this,t=e.constructor,r=xe(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+r:r};function J(e){var t,r,n,i=e.length-1,o="",s=e[0];if(i>0){for(o+=s,t=1;t<i;t++)n=e[t]+"",r=E-n.length,r&&(o+=Fe(r)),o+=n;s=e[t],n=s+"",r=E-n.length,r&&(o+=Fe(r))}else if(s===0)return"0";for(;s%10===0;)s/=10;return o+s}function ae(e,t,r){if(e!==~~e||e<t||e>r)throw Error($e+e)}function er(e,t,r,n){var i,o,s,a;for(o=e[0];o>=10;o/=10)--t;return--t<0?(t+=E,i=0):(i=Math.ceil((t+1)/E),t%=E),o=H(10,E-t),a=e[i]%o|0,n==null?t<3?(t==0?a=a/100|0:t==1&&(a=a/10|0),s=r<4&&a==99999||r>3&&a==49999||a==5e4||a==0):s=(r<4&&a+1==o||r>3&&a+1==o/2)&&(e[i+1]/o/100|0)==H(10,t-2)-1||(a==o/2||a==0)&&(e[i+1]/o/100|0)==0:t<4?(t==0?a=a/1e3|0:t==1?a=a/100|0:t==2&&(a=a/10|0),s=(n||r<4)&&a==9999||!n&&r>3&&a==4999):s=((n||r<4)&&a+1==o||!n&&r>3&&a+1==o/2)&&(e[i+1]/o/1e3|0)==H(10,t-3)-1,s}function Xr(e,t,r){for(var n,i=[0],o,s=0,a=e.length;s<a;){for(o=i.length;o--;)i[o]*=t;for(i[0]+=Pi.indexOf(e.charAt(s++)),n=0;n<i.length;n++)i[n]>r-1&&(i[n+1]===void 0&&(i[n+1]=0),i[n+1]+=i[n]/r|0,i[n]%=r)}return i.reverse()}function xp(e,t){var r,n,i;if(t.isZero())return t;n=t.d.length,n<32?(r=Math.ceil(n/3),i=(1/an(4,r)).toString()):(r=16,i="2.3283064365386962890625e-10"),e.precision+=r,t=gt(e,1,t.times(i),new e(1));for(var o=r;o--;){var s=t.times(t);t=s.times(s).minus(s).times(8).plus(1)}return e.precision-=r,t}var N=function(){function e(n,i,o){var s,a=0,l=n.length;for(n=n.slice();l--;)s=n[l]*i+a,n[l]=s%o|0,a=s/o|0;return a&&n.unshift(a),n}function t(n,i,o,s){var a,l;if(o!=s)l=o>s?1:-1;else for(a=l=0;a<o;a++)if(n[a]!=i[a]){l=n[a]>i[a]?1:-1;break}return l}function r(n,i,o,s){for(var a=0;o--;)n[o]-=a,a=n[o]<i[o]?1:0,n[o]=a*s+n[o]-i[o];for(;!n[0]&&n.length>1;)n.shift()}return function(n,i,o,s,a,l){var u,c,p,d,f,g,h,I,T,C,w,O,me,ce,Bt,U,oe,Se,Y,ut,Gr=n.constructor,oi=n.s==i.s?1:-1,Z=n.d,_=i.d;if(!Z||!Z[0]||!_||!_[0])return new Gr(!n.s||!i.s||(Z?_&&Z[0]==_[0]:!_)?NaN:Z&&Z[0]==0||!_?oi*0:oi/0);for(l?(f=1,c=n.e-i.e):(l=ge,f=E,c=te(n.e/f)-te(i.e/f)),Y=_.length,oe=Z.length,T=new Gr(oi),C=T.d=[],p=0;_[p]==(Z[p]||0);p++);if(_[p]>(Z[p]||0)&&c--,o==null?(ce=o=Gr.precision,s=Gr.rounding):a?ce=o+(n.e-i.e)+1:ce=o,ce<0)C.push(1),g=!0;else{if(ce=ce/f+2|0,p=0,Y==1){for(d=0,_=_[0],ce++;(p<oe||d)&&ce--;p++)Bt=d*l+(Z[p]||0),C[p]=Bt/_|0,d=Bt%_|0;g=d||p<oe}else{for(d=l/(_[0]+1)|0,d>1&&(_=e(_,d,l),Z=e(Z,d,l),Y=_.length,oe=Z.length),U=Y,w=Z.slice(0,Y),O=w.length;O<Y;)w[O++]=0;ut=_.slice(),ut.unshift(0),Se=_[0],_[1]>=l/2&&++Se;do d=0,u=t(_,w,Y,O),u<0?(me=w[0],Y!=O&&(me=me*l+(w[1]||0)),d=me/Se|0,d>1?(d>=l&&(d=l-1),h=e(_,d,l),I=h.length,O=w.length,u=t(h,w,I,O),u==1&&(d--,r(h,Y<I?ut:_,I,l))):(d==0&&(u=d=1),h=_.slice()),I=h.length,I<O&&h.unshift(0),r(w,h,O,l),u==-1&&(O=w.length,u=t(_,w,Y,O),u<1&&(d++,r(w,Y<O?ut:_,O,l))),O=w.length):u===0&&(d++,w=[0]),C[p++]=d,u&&w[0]?w[O++]=Z[U]||0:(w=[Z[U]],O=1);while((U++<oe||w[0]!==void 0)&&ce--);g=w[0]!==void 0}C[0]||C.shift()}if(f==1)T.e=c,Is=g;else{for(p=1,d=C[0];d>=10;d/=10)p++;T.e=p+c*f-1,y(T,a?o+T.e+1:o,s,g)}return T}}();function y(e,t,r,n){var i,o,s,a,l,u,c,p,d,f=e.constructor;e:if(t!=null){if(p=e.d,!p)return e;for(i=1,a=p[0];a>=10;a/=10)i++;if(o=t-i,o<0)o+=E,s=t,c=p[d=0],l=c/H(10,i-s-1)%10|0;else if(d=Math.ceil((o+1)/E),a=p.length,d>=a)if(n){for(;a++<=d;)p.push(0);c=l=0,i=1,o%=E,s=o-E+1}else break e;else{for(c=a=p[d],i=1;a>=10;a/=10)i++;o%=E,s=o-E+i,l=s<0?0:c/H(10,i-s-1)%10|0}if(n=n||t<0||p[d+1]!==void 0||(s<0?c:c%H(10,i-s-1)),u=r<4?(l||n)&&(r==0||r==(e.s<0?3:2)):l>5||l==5&&(r==4||n||r==6&&(o>0?s>0?c/H(10,i-s):0:p[d-1])%10&1||r==(e.s<0?8:7)),t<1||!p[0])return p.length=0,u?(t-=e.e+1,p[0]=H(10,(E-t%E)%E),e.e=-t||0):p[0]=e.e=0,e;if(o==0?(p.length=d,a=1,d--):(p.length=d+1,a=H(10,E-o),p[d]=s>0?(c/H(10,i-s)%H(10,s)|0)*a:0),u)for(;;)if(d==0){for(o=1,s=p[0];s>=10;s/=10)o++;for(s=p[0]+=a,a=1;s>=10;s/=10)a++;o!=a&&(e.e++,p[0]==ge&&(p[0]=1));break}else{if(p[d]+=a,p[d]!=ge)break;p[d--]=0,a=1}for(o=p.length;p[--o]===0;)p.pop()}return x&&(e.e>f.maxE?(e.d=null,e.e=NaN):e.e<f.minE&&(e.e=0,e.d=[0])),e}function xe(e,t,r){if(!e.isFinite())return Ls(e);var n,i=e.e,o=J(e.d),s=o.length;return t?(r&&(n=r-s)>0?o=o.charAt(0)+"."+o.slice(1)+Fe(n):s>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(e.e<0?"e":"e+")+e.e):i<0?(o="0."+Fe(-i-1)+o,r&&(n=r-s)>0&&(o+=Fe(n))):i>=s?(o+=Fe(i+1-s),r&&(n=r-i-1)>0&&(o=o+"."+Fe(n))):((n=i+1)<s&&(o=o.slice(0,n)+"."+o.slice(n)),r&&(n=r-s)>0&&(i+1===s&&(o+="."),o+=Fe(n))),o}function sn(e,t){var r=e[0];for(t*=E;r>=10;r/=10)t++;return t}function nn(e,t,r){if(t>Ep)throw x=!0,r&&(e.precision=r),Error(ks);return y(new e(tn),t,1,!0)}function Ee(e,t,r){if(t>Ti)throw Error(ks);return y(new e(rn),t,r,!0)}function Ns(e){var t=e.length-1,r=t*E+1;if(t=e[t],t){for(;t%10==0;t/=10)r--;for(t=e[0];t>=10;t/=10)r++}return r}function Fe(e){for(var t="";e--;)t+="0";return t}function Ms(e,t,r,n){var i,o=new e(1),s=Math.ceil(n/E+4);for(x=!1;;){if(r%2&&(o=o.times(t),Ss(o.d,s)&&(i=!0)),r=te(r/2),r===0){r=o.d.length-1,i&&o.d[r]===0&&++o.d[r];break}t=t.times(t),Ss(t.d,s)}return x=!0,o}function Cs(e){return e.d[e.d.length-1]&1}function Fs(e,t,r){for(var n,i,o=new e(t[0]),s=0;++s<t.length;){if(i=new e(t[s]),!i.s){o=i;break}n=o.cmp(i),(n===r||n===0&&o.s===r)&&(o=i)}return o}function Ai(e,t){var r,n,i,o,s,a,l,u=0,c=0,p=0,d=e.constructor,f=d.rounding,g=d.precision;if(!e.d||!e.d[0]||e.e>17)return new d(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(t==null?(x=!1,l=g):l=t,a=new d(.03125);e.e>-2;)e=e.times(a),p+=5;for(n=Math.log(H(2,p))/Math.LN10*2+5|0,l+=n,r=o=s=new d(1),d.precision=l;;){if(o=y(o.times(e),l,1),r=r.times(++c),a=s.plus(N(o,r,l,1)),J(a.d).slice(0,l)===J(s.d).slice(0,l)){for(i=p;i--;)s=y(s.times(s),l,1);if(t==null)if(u<3&&er(s.d,l-n,f,u))d.precision=l+=10,r=o=a=new d(1),c=0,u++;else return y(s,d.precision=g,f,x=!0);else return d.precision=g,s}s=a}}function Le(e,t){var r,n,i,o,s,a,l,u,c,p,d,f=1,g=10,h=e,I=h.d,T=h.constructor,C=T.rounding,w=T.precision;if(h.s<0||!I||!I[0]||!h.e&&I[0]==1&&I.length==1)return new T(I&&!I[0]?-1/0:h.s!=1?NaN:I?0:h);if(t==null?(x=!1,c=w):c=t,T.precision=c+=g,r=J(I),n=r.charAt(0),Math.abs(o=h.e)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)h=h.times(e),r=J(h.d),n=r.charAt(0),f++;o=h.e,n>1?(h=new T("0."+r),o++):h=new T(n+"."+r.slice(1))}else return u=nn(T,c+2,w).times(o+""),h=Le(new T(n+"."+r.slice(1)),c-g).plus(u),T.precision=w,t==null?y(h,w,C,x=!0):h;for(p=h,l=s=h=N(h.minus(1),h.plus(1),c,1),d=y(h.times(h),c,1),i=3;;){if(s=y(s.times(d),c,1),u=l.plus(N(s,new T(i),c,1)),J(u.d).slice(0,c)===J(l.d).slice(0,c))if(l=l.times(2),o!==0&&(l=l.plus(nn(T,c+2,w).times(o+""))),l=N(l,new T(f),c,1),t==null)if(er(l.d,c-g,C,a))T.precision=c+=g,u=s=h=N(p.minus(1),p.plus(1),c,1),d=y(h.times(h),c,1),i=a=1;else return y(l,T.precision=w,C,x=!0);else return T.precision=w,l;l=u,i+=2}}function Ls(e){return String(e.s*e.s/0)}function en(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;n++);for(i=t.length;t.charCodeAt(i-1)===48;--i);if(t=t.slice(n,i),t){if(i-=n,e.e=r=r-n-1,e.d=[],n=(r+1)%E,r<0&&(n+=E),n<i){for(n&&e.d.push(+t.slice(0,n)),i-=E;n<i;)e.d.push(+t.slice(n,n+=E));t=t.slice(n),n=E-t.length}else n-=i;for(;n--;)t+="0";e.d.push(+t),x&&(e.e>e.constructor.maxE?(e.d=null,e.e=NaN):e.e<e.constructor.minE&&(e.e=0,e.d=[0]))}else e.e=0,e.d=[0];return e}function bp(e,t){var r,n,i,o,s,a,l,u,c;if(t.indexOf("_")>-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),_s.test(t))return en(e,t)}else if(t==="Infinity"||t==="NaN")return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(hp.test(t))r=16,t=t.toLowerCase();else if(gp.test(t))r=2;else if(yp.test(t))r=8;else throw Error($e+t);for(o=t.search(/p/i),o>0?(l=+t.slice(o+1),t=t.substring(2,o)):t=t.slice(2),o=t.indexOf("."),s=o>=0,n=e.constructor,s&&(t=t.replace(".",""),a=t.length,o=a-o,i=Ms(n,new n(r),o,o*2)),u=Xr(t,r,ge),c=u.length-1,o=c;u[o]===0;--o)u.pop();return o<0?new n(e.s*0):(e.e=sn(u,c),e.d=u,x=!1,s&&(e=N(e,i,a*4)),l&&(e=e.times(Math.abs(l)<54?H(2,l):Ye.pow(2,l))),x=!0,e)}function Pp(e,t){var r,n=t.d.length;if(n<3)return t.isZero()?t:gt(e,2,t,t);r=1.4*Math.sqrt(n),r=r>16?16:r|0,t=t.times(1/an(5,r)),t=gt(e,2,t,t);for(var i,o=new e(5),s=new e(16),a=new e(20);r--;)i=t.times(t),t=t.times(o.plus(i.times(s.times(i).minus(a))));return t}function gt(e,t,r,n,i){var o,s,a,l,u=1,c=e.precision,p=Math.ceil(c/E);for(x=!1,l=r.times(r),a=new e(n);;){if(s=N(a.times(l),new e(t++*t++),c,1),a=i?n.plus(s):n.minus(s),n=N(s.times(l),new e(t++*t++),c,1),s=a.plus(n),s.d[p]!==void 0){for(o=p;s.d[o]===a.d[o]&&o--;);if(o==-1)break}o=a,a=n,n=s,s=o,u++}return x=!0,s.d.length=p+1,s}function an(e,t){for(var r=e;--t;)r*=e;return r}function $s(e,t){var r,n=t.s<0,i=Ee(e,e.precision,1),o=i.times(.5);if(t=t.abs(),t.lte(o))return Oe=n?4:1,t;if(r=t.divToInt(i),r.isZero())Oe=n?3:2;else{if(t=t.minus(r.times(i)),t.lte(o))return Oe=Cs(r)?n?2:3:n?4:1,t;Oe=Cs(r)?n?1:4:n?3:2}return t.minus(i).abs()}function Ci(e,t,r,n){var i,o,s,a,l,u,c,p,d,f=e.constructor,g=r!==void 0;if(g?(ae(r,1,Ve),n===void 0?n=f.rounding:ae(n,0,8)):(r=f.precision,n=f.rounding),!e.isFinite())c=Ls(e);else{for(c=xe(e),s=c.indexOf("."),g?(i=2,t==16?r=r*4-3:t==8&&(r=r*3-2)):i=t,s>=0&&(c=c.replace(".",""),d=new f(1),d.e=c.length-s,d.d=Xr(xe(d),10,i),d.e=d.d.length),p=Xr(c,10,i),o=l=p.length;p[--l]==0;)p.pop();if(!p[0])c=g?"0p+0":"0";else{if(s<0?o--:(e=new f(e),e.d=p,e.e=o,e=N(e,d,r,n,0,i),p=e.d,o=e.e,u=Is),s=p[r],a=i/2,u=u||p[r+1]!==void 0,u=n<4?(s!==void 0||u)&&(n===0||n===(e.s<0?3:2)):s>a||s===a&&(n===4||u||n===6&&p[r-1]&1||n===(e.s<0?8:7)),p.length=r,u)for(;++p[--r]>i-1;)p[r]=0,r||(++o,p.unshift(1));for(l=p.length;!p[l-1];--l);for(s=0,c="";s<l;s++)c+=Pi.charAt(p[s]);if(g){if(l>1)if(t==16||t==8){for(s=t==16?4:3,--l;l%s;l++)c+="0";for(p=Xr(c,i,t),l=p.length;!p[l-1];--l);for(s=1,c="1.";s<l;s++)c+=Pi.charAt(p[s])}else c=c.charAt(0)+"."+c.slice(1);c=c+(o<0?"p":"p+")+o}else if(o<0){for(;++o;)c="0"+c;c="0."+c}else if(++o>l)for(o-=l;o--;)c+="0";else o<l&&(c=c.slice(0,o)+"."+c.slice(o))}c=(t==16?"0x":t==2?"0b":t==8?"0o":"")+c}return e.s<0?"-"+c:c}function Ss(e,t){if(e.length>t)return e.length=t,!0}function vp(e){return new this(e).abs()}function Tp(e){return new this(e).acos()}function Ap(e){return new this(e).acosh()}function Cp(e,t){return new this(e).plus(t)}function Sp(e){return new this(e).asin()}function Rp(e){return new this(e).asinh()}function Ip(e){return new this(e).atan()}function kp(e){return new this(e).atanh()}function Op(e,t){e=new this(e),t=new this(t);var r,n=this.precision,i=this.rounding,o=n+4;return!e.s||!t.s?r=new this(NaN):!e.d&&!t.d?(r=Ee(this,o,1).times(t.s>0?.25:.75),r.s=e.s):!t.d||e.isZero()?(r=t.s<0?Ee(this,n,i):new this(0),r.s=e.s):!e.d||t.isZero()?(r=Ee(this,o,1).times(.5),r.s=e.s):t.s<0?(this.precision=o,this.rounding=1,r=this.atan(N(e,t,o,1)),t=Ee(this,o,1),this.precision=n,this.rounding=i,r=e.s<0?r.minus(t):r.plus(t)):r=this.atan(N(e,t,o,1)),r}function Dp(e){return new this(e).cbrt()}function _p(e){return y(e=new this(e),e.e+1,2)}function Np(e,t,r){return new this(e).clamp(t,r)}function Mp(e){if(!e||typeof e!="object")throw Error(on+"Object expected");var t,r,n,i=e.defaults===!0,o=["precision",1,Ve,"rounding",0,8,"toExpNeg",-ft,0,"toExpPos",0,ft,"maxE",0,ft,"minE",-ft,0,"modulo",0,9];for(t=0;t<o.length;t+=3)if(r=o[t],i&&(this[r]=vi[r]),(n=e[r])!==void 0)if(te(n)===n&&n>=o[t+1]&&n<=o[t+2])this[r]=n;else throw Error($e+r+": "+n);if(r="crypto",i&&(this[r]=vi[r]),(n=e[r])!==void 0)if(n===!0||n===!1||n===0||n===1)if(n)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[r]=!0;else throw Error(Os);else this[r]=!1;else throw Error($e+r+": "+n);return this}function Fp(e){return new this(e).cos()}function Lp(e){return new this(e).cosh()}function Vs(e){var t,r,n;function i(o){var s,a,l,u=this;if(!(u instanceof i))return new i(o);if(u.constructor=i,Rs(o)){u.s=o.s,x?!o.d||o.e>i.maxE?(u.e=NaN,u.d=null):o.e<i.minE?(u.e=0,u.d=[0]):(u.e=o.e,u.d=o.d.slice()):(u.e=o.e,u.d=o.d?o.d.slice():o.d);return}if(l=typeof o,l==="number"){if(o===0){u.s=1/o<0?-1:1,u.e=0,u.d=[0];return}if(o<0?(o=-o,u.s=-1):u.s=1,o===~~o&&o<1e7){for(s=0,a=o;a>=10;a/=10)s++;x?s>i.maxE?(u.e=NaN,u.d=null):s<i.minE?(u.e=0,u.d=[0]):(u.e=s,u.d=[o]):(u.e=s,u.d=[o]);return}if(o*0!==0){o||(u.s=NaN),u.e=NaN,u.d=null;return}return en(u,o.toString())}if(l==="string")return(a=o.charCodeAt(0))===45?(o=o.slice(1),u.s=-1):(a===43&&(o=o.slice(1)),u.s=1),_s.test(o)?en(u,o):bp(u,o);if(l==="bigint")return o<0?(o=-o,u.s=-1):u.s=1,en(u,o.toString());throw Error($e+o)}if(i.prototype=m,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.EUCLID=9,i.config=i.set=Mp,i.clone=Vs,i.isDecimal=Rs,i.abs=vp,i.acos=Tp,i.acosh=Ap,i.add=Cp,i.asin=Sp,i.asinh=Rp,i.atan=Ip,i.atanh=kp,i.atan2=Op,i.cbrt=Dp,i.ceil=_p,i.clamp=Np,i.cos=Fp,i.cosh=Lp,i.div=$p,i.exp=Vp,i.floor=qp,i.hypot=Up,i.ln=jp,i.log=Bp,i.log10=Hp,i.log2=Qp,i.max=Gp,i.min=Wp,i.mod=Jp,i.mul=Kp,i.pow=zp,i.random=Yp,i.round=Zp,i.sign=Xp,i.sin=ed,i.sinh=td,i.sqrt=rd,i.sub=nd,i.sum=id,i.tan=od,i.tanh=sd,i.trunc=ad,e===void 0&&(e={}),e&&e.defaults!==!0)for(n=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],t=0;t<n.length;)e.hasOwnProperty(r=n[t++])||(e[r]=this[r]);return i.config(e),i}function $p(e,t){return new this(e).div(t)}function Vp(e){return new this(e).exp()}function qp(e){return y(e=new this(e),e.e+1,3)}function Up(){var e,t,r=new this(0);for(x=!1,e=0;e<arguments.length;)if(t=new this(arguments[e++]),t.d)r.d&&(r=r.plus(t.times(t)));else{if(t.s)return x=!0,new this(1/0);r=t}return x=!0,r.sqrt()}function Rs(e){return e instanceof Ye||e&&e.toStringTag===Ds||!1}function jp(e){return new this(e).ln()}function Bp(e,t){return new this(e).log(t)}function Qp(e){return new this(e).log(2)}function Hp(e){return new this(e).log(10)}function Gp(){return Fs(this,arguments,-1)}function Wp(){return Fs(this,arguments,1)}function Jp(e,t){return new this(e).mod(t)}function Kp(e,t){return new this(e).mul(t)}function zp(e,t){return new this(e).pow(t)}function Yp(e){var t,r,n,i,o=0,s=new this(1),a=[];if(e===void 0?e=this.precision:ae(e,1,Ve),n=Math.ceil(e/E),this.crypto)if(crypto.getRandomValues)for(t=crypto.getRandomValues(new Uint32Array(n));o<n;)i=t[o],i>=429e7?t[o]=crypto.getRandomValues(new Uint32Array(1))[0]:a[o++]=i%1e7;else if(crypto.randomBytes){for(t=crypto.randomBytes(n*=4);o<n;)i=t[o]+(t[o+1]<<8)+(t[o+2]<<16)+((t[o+3]&127)<<24),i>=214e7?crypto.randomBytes(4).copy(t,o):(a.push(i%1e7),o+=4);o=n/4}else throw Error(Os);else for(;o<n;)a[o++]=Math.random()*1e7|0;for(n=a[--o],e%=E,n&&e&&(i=H(10,E-e),a[o]=(n/i|0)*i);a[o]===0;o--)a.pop();if(o<0)r=0,a=[0];else{for(r=-1;a[0]===0;r-=E)a.shift();for(n=1,i=a[0];i>=10;i/=10)n++;n<E&&(r-=E-n)}return s.e=r,s.d=a,s}function Zp(e){return y(e=new this(e),e.e+1,this.rounding)}function Xp(e){return e=new this(e),e.d?e.d[0]?e.s:0*e.s:e.s||NaN}function ed(e){return new this(e).sin()}function td(e){return new this(e).sinh()}function rd(e){return new this(e).sqrt()}function nd(e,t){return new this(e).sub(t)}function id(){var e=0,t=arguments,r=new this(t[e]);for(x=!1;r.s&&++e<t.length;)r=r.plus(t[e]);return x=!0,y(r,this.precision,this.rounding)}function od(e){return new this(e).tan()}function sd(e){return new this(e).tanh()}function ad(e){return y(e=new this(e),e.e+1,1)}m[Symbol.for("nodejs.util.inspect.custom")]=m.toString;m[Symbol.toStringTag]="Decimal";var Ye=m.constructor=Vs(vi);tn=new Ye(tn);rn=new Ye(rn);var K=Ye;function qe(e){return e===null?e:Array.isArray(e)?e.map(qe):typeof e=="object"?ld(e)?ud(e):e.constructor!==null&&e.constructor.name!=="Object"?e:mt(e,qe):e}function ld(e){return e!==null&&typeof e=="object"&&typeof e.$type=="string"}function ud({$type:e,value:t}){switch(e){case"BigInt":return BigInt(t);case"Bytes":{let{buffer:r,byteOffset:n,byteLength:i}=Buffer.from(t,"base64");return new Uint8Array(r,n,i)}case"DateTime":return new Date(t);case"Decimal":return new K(t);case"Json":return JSON.parse(t);default:fe(t,"Unknown tagged value")}}var be=class{_map=new Map;get(t){return this._map.get(t)?.value}set(t,r){this._map.set(t,{value:r})}getOrCreate(t,r){let n=this._map.get(t);if(n)return n.value;let i=r();return this.set(t,i),i}};function Ue(e){return e.substring(0,1).toLowerCase()+e.substring(1)}function qs(e,t){let r={};for(let n of e){let i=n[t];r[i]=n}return r}function tr(e){let t;return{get(){return t||(t={value:e()}),t.value}}}function Us(e){return{models:Si(e.models),enums:Si(e.enums),types:Si(e.types)}}function Si(e){let t={};for(let{name:r,...n}of e)t[r]=n;return t}function ht(e){return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}function ln(e){return e.toString()!=="Invalid Date"}function yt(e){return Ye.isDecimal(e)?!0:e!==null&&typeof e=="object"&&typeof e.s=="number"&&typeof e.e=="number"&&typeof e.toFixed=="function"&&Array.isArray(e.d)}var rr={};ct(rr,{ModelAction:()=>wt,datamodelEnumToSchemaEnum:()=>cd});function cd(e){return{name:e.name,values:e.values.map(t=>t.name)}}var wt=(w=>(w.findUnique="findUnique",w.findUniqueOrThrow="findUniqueOrThrow",w.findFirst="findFirst",w.findFirstOrThrow="findFirstOrThrow",w.findMany="findMany",w.create="create",w.createMany="createMany",w.createManyAndReturn="createManyAndReturn",w.update="update",w.updateMany="updateMany",w.updateManyAndReturn="updateManyAndReturn",w.upsert="upsert",w.delete="delete",w.deleteMany="deleteMany",w.groupBy="groupBy",w.count="count",w.aggregate="aggregate",w.findRaw="findRaw",w.aggregateRaw="aggregateRaw",w))(wt||{});var Gs=j(us());var Hs=j(require("node:fs"));var js={keyword:Ie,entity:Ie,value:e=>re(ze(e)),punctuation:ze,directive:Ie,function:Ie,variable:e=>re(ze(e)),string:e=>re(Qt(e)),boolean:Ke,number:Ie,comment:Ht};var pd=e=>e,un={},dd=0,v={manual:un.Prism&&un.Prism.manual,disableWorkerMessageHandler:un.Prism&&un.Prism.disableWorkerMessageHandler,util:{encode:function(e){if(e instanceof he){let t=e;return new he(t.type,v.util.encode(t.content),t.alias)}else return Array.isArray(e)?e.map(v.util.encode):e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++dd}),e.__id},clone:function e(t,r){let n,i,o=v.util.type(t);switch(r=r||{},o){case"Object":if(i=v.util.objId(t),r[i])return r[i];n={},r[i]=n;for(let s in t)t.hasOwnProperty(s)&&(n[s]=e(t[s],r));return n;case"Array":return i=v.util.objId(t),r[i]?r[i]:(n=[],r[i]=n,t.forEach(function(s,a){n[a]=e(s,r)}),n);default:return t}}},languages:{extend:function(e,t){let r=v.util.clone(v.languages[e]);for(let n in t)r[n]=t[n];return r},insertBefore:function(e,t,r,n){n=n||v.languages;let i=n[e],o={};for(let a in i)if(i.hasOwnProperty(a)){if(a==t)for(let l in r)r.hasOwnProperty(l)&&(o[l]=r[l]);r.hasOwnProperty(a)||(o[a]=i[a])}let s=n[e];return n[e]=o,v.languages.DFS(v.languages,function(a,l){l===s&&a!=e&&(this[a]=o)}),o},DFS:function e(t,r,n,i){i=i||{};let o=v.util.objId;for(let s in t)if(t.hasOwnProperty(s)){r.call(t,s,t[s],n||s);let a=t[s],l=v.util.type(a);l==="Object"&&!i[o(a)]?(i[o(a)]=!0,e(a,r,null,i)):l==="Array"&&!i[o(a)]&&(i[o(a)]=!0,e(a,r,s,i))}}},plugins:{},highlight:function(e,t,r){let n={code:e,grammar:t,language:r};return v.hooks.run("before-tokenize",n),n.tokens=v.tokenize(n.code,n.grammar),v.hooks.run("after-tokenize",n),he.stringify(v.util.encode(n.tokens),n.language)},matchGrammar:function(e,t,r,n,i,o,s){for(let h in r){if(!r.hasOwnProperty(h)||!r[h])continue;if(h==s)return;let I=r[h];I=v.util.type(I)==="Array"?I:[I];for(let T=0;T<I.length;++T){let C=I[T],w=C.inside,O=!!C.lookbehind,me=!!C.greedy,ce=0,Bt=C.alias;if(me&&!C.pattern.global){let U=C.pattern.toString().match(/[imuy]*$/)[0];C.pattern=RegExp(C.pattern.source,U+"g")}C=C.pattern||C;for(let U=n,oe=i;U<t.length;oe+=t[U].length,++U){let Se=t[U];if(t.length>e.length)return;if(Se instanceof he)continue;if(me&&U!=t.length-1){C.lastIndex=oe;var p=C.exec(e);if(!p)break;var c=p.index+(O?p[1].length:0),d=p.index+p[0].length,a=U,l=oe;for(let _=t.length;a<_&&(l<d||!t[a].type&&!t[a-1].greedy);++a)l+=t[a].length,c>=l&&(++U,oe=l);if(t[U]instanceof he)continue;u=a-U,Se=e.slice(oe,l),p.index-=oe}else{C.lastIndex=0;var p=C.exec(Se),u=1}if(!p){if(o)break;continue}O&&(ce=p[1]?p[1].length:0);var c=p.index+ce,p=p[0].slice(ce),d=c+p.length,f=Se.slice(0,c),g=Se.slice(d);let Y=[U,u];f&&(++U,oe+=f.length,Y.push(f));let ut=new he(h,w?v.tokenize(p,w):p,Bt,p,me);if(Y.push(ut),g&&Y.push(g),Array.prototype.splice.apply(t,Y),u!=1&&v.matchGrammar(e,t,r,U,oe,!0,h),o)break}}}},tokenize:function(e,t){let r=[e],n=t.rest;if(n){for(let i in n)t[i]=n[i];delete t.rest}return v.matchGrammar(e,r,t,0,0,!1),r},hooks:{all:{},add:function(e,t){let r=v.hooks.all;r[e]=r[e]||[],r[e].push(t)},run:function(e,t){let r=v.hooks.all[e];if(!(!r||!r.length))for(var n=0,i;i=r[n++];)i(t)}},Token:he};v.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/((?:\b(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,boolean:/\b(?:true|false)\b/,function:/\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&?|\|\|?|\?|\*|\/|~|\^|%/,punctuation:/[{}[\];(),.:]/};v.languages.javascript=v.languages.extend("clike",{"class-name":[v.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])[_$A-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\.(?:prototype|constructor))/,lookbehind:!0}],keyword:[{pattern:/((?:^|})\s*)(?:catch|finally)\b/,lookbehind:!0},{pattern:/(^|[^.])\b(?:as|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],number:/\b(?:(?:0[xX](?:[\dA-Fa-f](?:_[\dA-Fa-f])?)+|0[bB](?:[01](?:_[01])?)+|0[oO](?:[0-7](?:_[0-7])?)+)n?|(?:\d(?:_\d)?)+n|NaN|Infinity)\b|(?:\b(?:\d(?:_\d)?)+\.?(?:\d(?:_\d)?)*|\B\.(?:\d(?:_\d)?)+)(?:[Ee][+-]?(?:\d(?:_\d)?)+)?/,function:/[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,operator:/-[-=]?|\+[+=]?|!=?=?|<<?=?|>>?>?=?|=(?:==?|>)?|&[&=]?|\|[|=]?|\*\*?=?|\/=?|~|\^=?|%=?|\?|\.{3}/});v.languages.javascript["class-name"][0].pattern=/(\b(?:class|interface|extends|implements|instanceof|new)\s+)[\w.\\]+/;v.languages.insertBefore("javascript","keyword",{regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s])\s*)\/(\[(?:[^\]\\\r\n]|\\.)*]|\\.|[^/\\\[\r\n])+\/[gimyus]{0,6}(?=\s*($|[\r\n,.;})\]]))/,lookbehind:!0,greedy:!0},"function-variable":{pattern:/[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)?\s*\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\))/,lookbehind:!0,inside:v.languages.javascript},{pattern:/[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*=>)/i,inside:v.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*=>)/,lookbehind:!0,inside:v.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*\s*)\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*\{)/,lookbehind:!0,inside:v.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/});v.languages.markup&&v.languages.markup.tag.addInlined("script","javascript");v.languages.js=v.languages.javascript;v.languages.typescript=v.languages.extend("javascript",{keyword:/\b(?:abstract|as|async|await|break|case|catch|class|const|constructor|continue|debugger|declare|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|is|keyof|let|module|namespace|new|null|of|package|private|protected|public|readonly|return|require|set|static|super|switch|this|throw|try|type|typeof|var|void|while|with|yield)\b/,builtin:/\b(?:string|Function|any|number|boolean|Array|symbol|console|Promise|unknown|never)\b/});v.languages.ts=v.languages.typescript;function he(e,t,r,n,i){this.type=e,this.content=t,this.alias=r,this.length=(n||"").length|0,this.greedy=!!i}he.stringify=function(e,t){return typeof e=="string"?e:Array.isArray(e)?e.map(function(r){return he.stringify(r,t)}).join(""):md(e.type)(e.content)};function md(e){return js[e]||pd}function Bs(e){return fd(e,v.languages.javascript)}function fd(e,t){return v.tokenize(e,t).map(n=>he.stringify(n)).join("")}function Qs(e){return pi(e)}var cn=class e{firstLineNumber;lines;static read(t){let r;try{r=Hs.default.readFileSync(t,"utf-8")}catch{return null}return e.fromContent(r)}static fromContent(t){let r=t.split(/\r?\n/);return new e(1,r)}constructor(t,r){this.firstLineNumber=t,this.lines=r}get lastLineNumber(){return this.firstLineNumber+this.lines.length-1}mapLineAt(t,r){if(t<this.firstLineNumber||t>this.lines.length+this.firstLineNumber)return this;let n=t-this.firstLineNumber,i=[...this.lines];return i[n]=r(i[n]),new e(this.firstLineNumber,i)}mapLines(t){return new e(this.firstLineNumber,this.lines.map((r,n)=>t(r,this.firstLineNumber+n)))}lineAt(t){return this.lines[t-this.firstLineNumber]}prependSymbolAt(t,r){return this.mapLines((n,i)=>i===t?`${r} ${n}`:` ${n}`)}slice(t,r){let n=this.lines.slice(t-1,r).join(`
14
14
  `);return new e(t,Qs(n).split(`
15
15
  `))}highlight(){let t=Bs(this.toString());return new e(this.firstLineNumber,t.split(`
16
16
  `))}toString(){return this.lines.join(`
17
- `)}};var yd={red:Re,gray:Ht,dim:Je,bold:re,underline:se,highlightSource:e=>e.highlight()},hd={red:e=>e,gray:e=>e,dim:e=>e,bold:e=>e,underline:e=>e,highlightSource:e=>e};function wd({message:e,originalMethod:t,isPanic:r,callArguments:n}){return{functionName:`prisma.${t}()`,message:e,isPanic:r??!1,callArguments:n}}function Ed({callsite:e,message:t,originalMethod:r,isPanic:n,callArguments:i},o){let s=wd({message:t,originalMethod:r,isPanic:n,callArguments:i});if(!e||typeof window<"u"||process.env.NODE_ENV==="production")return s;let a=e.getLocation();if(!a||!a.lineNumber||!a.columnNumber)return s;let l=Math.max(1,a.lineNumber-3),u=cn.read(a.fileName)?.slice(l,a.lineNumber),c=u?.lineAt(a.lineNumber);if(u&&c){let p=bd(c),d=xd(c);if(!d)return s;s.functionName=`${d.code})`,s.location=a,n||(u=u.mapLineAt(a.lineNumber,g=>g.slice(0,d.openingBraceIndex))),u=o.highlightSource(u);let m=String(u.lastLineNumber).length;if(s.contextLines=u.mapLines((g,y)=>o.gray(String(y).padStart(m))+" "+g).mapLines(g=>o.dim(g)).prependSymbolAt(a.lineNumber,o.bold(o.red("\u2192"))),i){let g=p+m+1;g+=2,s.callArguments=(0,Gs.default)(i,g).slice(g)}}return s}function xd(e){let t=Object.keys(wt).join("|"),n=new RegExp(String.raw`\.(${t})\(`).exec(e);if(n){let i=n.index+n[0].length,o=e.lastIndexOf(" ",n.index)+1;return{code:e.slice(o,i),openingBraceIndex:i}}return null}function bd(e){let t=0;for(let r=0;r<e.length;r++){if(e.charAt(r)!==" ")return t;t++}return t}function Pd({functionName:e,location:t,message:r,isPanic:n,contextLines:i,callArguments:o},s){let a=[""],l=t?" in":":";if(n?(a.push(s.red(`Oops, an unknown error occurred! This is ${s.bold("on us")}, you did nothing wrong.`)),a.push(s.red(`It occurred in the ${s.bold(`\`${e}\``)} invocation${l}`))):a.push(s.red(`Invalid ${s.bold(`\`${e}\``)} invocation${l}`)),t&&a.push(s.underline(vd(t))),i){a.push("");let u=[i.toString()];o&&(u.push(o),u.push(s.dim(")"))),a.push(u.join("")),o&&a.push("")}else a.push(""),o&&a.push(o),a.push("");return a.push(r),a.join(`
18
- `)}function vd(e){let t=[e.fileName];return e.lineNumber&&t.push(String(e.lineNumber)),e.columnNumber&&t.push(String(e.columnNumber)),t.join(":")}function pn(e){let t=e.showColors?yd:hd,r;return r=Ed(e,t),Pd(r,t)}var ta=j(Ri());function zs(e,t,r){let n=Ys(e),i=Td(n),o=Cd(i);o?dn(o,t,r):t.addErrorMessage(()=>"Unknown error")}function Ys(e){return e.errors.flatMap(t=>t.kind==="Union"?Ys(t):[t])}function Td(e){let t=new Map,r=[];for(let n of e){if(n.kind!=="InvalidArgumentType"){r.push(n);continue}let i=`${n.selectionPath.join(".")}:${n.argumentPath.join(".")}`,o=t.get(i);o?t.set(i,{...n,argument:{...n.argument,typeNames:Ad(o.argument.typeNames,n.argument.typeNames)}}):t.set(i,n)}return r.push(...t.values()),r}function Ad(e,t){return[...new Set(e.concat(t))]}function Cd(e){return bi(e,(t,r)=>{let n=Js(t),i=Js(r);return n!==i?n-i:Ks(t)-Ks(r)})}function Js(e){let t=0;return Array.isArray(e.selectionPath)&&(t+=e.selectionPath.length),Array.isArray(e.argumentPath)&&(t+=e.argumentPath.length),t}function Ks(e){switch(e.kind){case"InvalidArgumentValue":case"ValueTooLarge":return 20;case"InvalidArgumentType":return 10;case"RequiredArgumentMissing":return-10;default:return 0}}var pe=class{constructor(t,r){this.name=t;this.value=r}isRequired=!1;makeRequired(){return this.isRequired=!0,this}write(t){let{colors:{green:r}}=t.context;t.addMarginSymbol(r(this.isRequired?"+":"?")),t.write(r(this.name)),this.isRequired||t.write(r("?")),t.write(r(": ")),typeof this.value=="string"?t.write(r(this.value)):t.write(this.value)}};Xs();var Et=class{constructor(t=0,r){this.context=r;this.currentIndent=t}lines=[];currentLine="";currentIndent=0;marginSymbol;afterNextNewLineCallback;write(t){return typeof t=="string"?this.currentLine+=t:t.write(this),this}writeJoined(t,r,n=(i,o)=>o.write(i)){let i=r.length-1;for(let o=0;o<r.length;o++)n(r[o],this),o!==i&&this.write(t);return this}writeLine(t){return this.write(t).newLine()}newLine(){this.lines.push(this.indentedCurrentLine()),this.currentLine="",this.marginSymbol=void 0;let t=this.afterNextNewLineCallback;return this.afterNextNewLineCallback=void 0,t?.(),this}withIndent(t){return this.indent(),t(this),this.unindent(),this}afterNextNewline(t){return this.afterNextNewLineCallback=t,this}indent(){return this.currentIndent++,this}unindent(){return this.currentIndent>0&&this.currentIndent--,this}addMarginSymbol(t){return this.marginSymbol=t,this}toString(){return this.lines.concat(this.indentedCurrentLine()).join(`
19
- `)}getCurrentLineLength(){return this.currentLine.length}indentedCurrentLine(){let t=this.currentLine.padStart(this.currentLine.length+2*this.currentIndent);return this.marginSymbol?this.marginSymbol+t.slice(1):t}};Zs();var mn=class{constructor(t){this.value=t}write(t){t.write(this.value)}markAsError(){this.value.markAsError()}};var fn=e=>e,gn={bold:fn,red:fn,green:fn,dim:fn,enabled:!1},ea={bold:re,red:Re,green:Qt,dim:Je,enabled:!0},xt={write(e){e.writeLine(",")}};var Pe=class{constructor(t){this.contents=t}isUnderlined=!1;color=t=>t;underline(){return this.isUnderlined=!0,this}setColor(t){return this.color=t,this}write(t){let r=t.getCurrentLineLength();t.write(this.color(this.contents)),this.isUnderlined&&t.afterNextNewline(()=>{t.write(" ".repeat(r)).writeLine(this.color("~".repeat(this.contents.length)))})}};var je=class{hasError=!1;markAsError(){return this.hasError=!0,this}};var bt=class extends je{items=[];addItem(t){return this.items.push(new mn(t)),this}getField(t){return this.items[t]}getPrintWidth(){return this.items.length===0?2:Math.max(...this.items.map(r=>r.value.getPrintWidth()))+2}write(t){if(this.items.length===0){this.writeEmpty(t);return}this.writeWithItems(t)}writeEmpty(t){let r=new Pe("[]");this.hasError&&r.setColor(t.context.colors.red).underline(),t.write(r)}writeWithItems(t){let{colors:r}=t.context;t.writeLine("[").withIndent(()=>t.writeJoined(xt,this.items).newLine()).write("]"),this.hasError&&t.afterNextNewline(()=>{t.writeLine(r.red("~".repeat(this.getPrintWidth())))})}asObject(){}};var Pt=class e extends je{fields={};suggestions=[];addField(t){this.fields[t.name]=t}addSuggestion(t){this.suggestions.push(t)}getField(t){return this.fields[t]}getDeepField(t){let[r,...n]=t,i=this.getField(r);if(!i)return;let o=i;for(let s of n){let a;if(o.value instanceof e?a=o.value.getField(s):o.value instanceof bt&&(a=o.value.getField(Number(s))),!a)return;o=a}return o}getDeepFieldValue(t){return t.length===0?this:this.getDeepField(t)?.value}hasField(t){return!!this.getField(t)}removeAllFields(){this.fields={}}removeField(t){delete this.fields[t]}getFields(){return this.fields}isEmpty(){return Object.keys(this.fields).length===0}getFieldValue(t){return this.getField(t)?.value}getDeepSubSelectionValue(t){let r=this;for(let n of t){if(!(r instanceof e))return;let i=r.getSubSelectionValue(n);if(!i)return;r=i}return r}getDeepSelectionParent(t){let r=this.getSelectionParent();if(!r)return;let n=r;for(let i of t){let o=n.value.getFieldValue(i);if(!o||!(o instanceof e))return;let s=o.getSelectionParent();if(!s)return;n=s}return n}getSelectionParent(){let t=this.getField("select")?.value.asObject();if(t)return{kind:"select",value:t};let r=this.getField("include")?.value.asObject();if(r)return{kind:"include",value:r}}getSubSelectionValue(t){return this.getSelectionParent()?.value.fields[t].value}getPrintWidth(){let t=Object.values(this.fields);return t.length==0?2:Math.max(...t.map(n=>n.getPrintWidth()))+2}write(t){let r=Object.values(this.fields);if(r.length===0&&this.suggestions.length===0){this.writeEmpty(t);return}this.writeWithContents(t,r)}asObject(){return this}writeEmpty(t){let r=new Pe("{}");this.hasError&&r.setColor(t.context.colors.red).underline(),t.write(r)}writeWithContents(t,r){t.writeLine("{").withIndent(()=>{t.writeJoined(xt,[...r,...this.suggestions]).newLine()}),t.write("}"),this.hasError&&t.afterNextNewline(()=>{t.writeLine(t.context.colors.red("~".repeat(this.getPrintWidth())))})}};var G=class extends je{constructor(r){super();this.text=r}getPrintWidth(){return this.text.length}write(r){let n=new Pe(this.text);this.hasError&&n.underline().setColor(r.context.colors.red),r.write(n)}asObject(){}};var nr=class{fields=[];addField(t,r){return this.fields.push({write(n){let{green:i,dim:o}=n.context.colors;n.write(i(o(`${t}: ${r}`))).addMarginSymbol(i(o("+")))}}),this}write(t){let{colors:{green:r}}=t.context;t.writeLine(r("{")).withIndent(()=>{t.writeJoined(xt,this.fields).newLine()}).write(r("}")).addMarginSymbol(r("+"))}};function dn(e,t,r){switch(e.kind){case"MutuallyExclusiveFields":Sd(e,t);break;case"IncludeOnScalar":Rd(e,t);break;case"EmptySelection":Id(e,t,r);break;case"UnknownSelectionField":_d(e,t);break;case"InvalidSelectionValue":Nd(e,t);break;case"UnknownArgument":Md(e,t);break;case"UnknownInputField":Fd(e,t);break;case"RequiredArgumentMissing":Ld(e,t);break;case"InvalidArgumentType":$d(e,t);break;case"InvalidArgumentValue":Vd(e,t);break;case"ValueTooLarge":qd(e,t);break;case"SomeFieldsMissing":Ud(e,t);break;case"TooManyFieldsGiven":jd(e,t);break;case"Union":zs(e,t,r);break;default:throw new Error("not implemented: "+e.kind)}}function Sd(e,t){let r=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();r&&(r.getField(e.firstField)?.markAsError(),r.getField(e.secondField)?.markAsError()),t.addErrorMessage(n=>`Please ${n.bold("either")} use ${n.green(`\`${e.firstField}\``)} or ${n.green(`\`${e.secondField}\``)}, but ${n.red("not both")} at the same time.`)}function Rd(e,t){let[r,n]=ir(e.selectionPath),i=e.outputType,o=t.arguments.getDeepSelectionParent(r)?.value;if(o&&(o.getField(n)?.markAsError(),i))for(let s of i.fields)s.isRelation&&o.addSuggestion(new pe(s.name,"true"));t.addErrorMessage(s=>{let a=`Invalid scalar field ${s.red(`\`${n}\``)} for ${s.bold("include")} statement`;return i?a+=` on model ${s.bold(i.name)}. ${or(s)}`:a+=".",a+=`
20
- Note that ${s.bold("include")} statements only accept relation fields.`,a})}function Id(e,t,r){let n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(n){let i=n.getField("omit")?.value.asObject();if(i){kd(e,t,i);return}if(n.hasField("select")){Od(e,t);return}}if(r?.[Ue(e.outputType.name)]){Dd(e,t);return}t.addErrorMessage(()=>`Unknown field at "${e.selectionPath.join(".")} selection"`)}function kd(e,t,r){r.removeAllFields();for(let n of e.outputType.fields)r.addSuggestion(new pe(n.name,"false"));t.addErrorMessage(n=>`The ${n.red("omit")} statement includes every field of the model ${n.bold(e.outputType.name)}. At least one field must be included in the result`)}function Od(e,t){let r=e.outputType,n=t.arguments.getDeepSelectionParent(e.selectionPath)?.value,i=n?.isEmpty()??!1;n&&(n.removeAllFields(),ia(n,r)),t.addErrorMessage(o=>i?`The ${o.red("`select`")} statement for type ${o.bold(r.name)} must not be empty. ${or(o)}`:`The ${o.red("`select`")} statement for type ${o.bold(r.name)} needs ${o.bold("at least one truthy value")}.`)}function Dd(e,t){let r=new nr;for(let i of e.outputType.fields)i.isRelation||r.addField(i.name,"false");let n=new pe("omit",r).makeRequired();if(e.selectionPath.length===0)t.arguments.addSuggestion(n);else{let[i,o]=ir(e.selectionPath),a=t.arguments.getDeepSelectionParent(i)?.value.asObject()?.getField(o);if(a){let l=a?.value.asObject()??new Pt;l.addSuggestion(n),a.value=l}}t.addErrorMessage(i=>`The global ${i.red("omit")} configuration excludes every field of the model ${i.bold(e.outputType.name)}. At least one field must be included in the result`)}function _d(e,t){let r=oa(e.selectionPath,t);if(r.parentKind!=="unknown"){r.field.markAsError();let n=r.parent;switch(r.parentKind){case"select":ia(n,e.outputType);break;case"include":Bd(n,e.outputType);break;case"omit":Qd(n,e.outputType);break}}t.addErrorMessage(n=>{let i=[`Unknown field ${n.red(`\`${r.fieldName}\``)}`];return r.parentKind!=="unknown"&&i.push(`for ${n.bold(r.parentKind)} statement`),i.push(`on model ${n.bold(`\`${e.outputType.name}\``)}.`),i.push(or(n)),i.join(" ")})}function Nd(e,t){let r=oa(e.selectionPath,t);r.parentKind!=="unknown"&&r.field.value.markAsError(),t.addErrorMessage(n=>`Invalid value for selection field \`${n.red(r.fieldName)}\`: ${e.underlyingError}`)}function Md(e,t){let r=e.argumentPath[0],n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();n&&(n.getField(r)?.markAsError(),Hd(n,e.arguments)),t.addErrorMessage(i=>ra(i,r,e.arguments.map(o=>o.name)))}function Fd(e,t){let[r,n]=ir(e.argumentPath),i=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(i){i.getDeepField(e.argumentPath)?.markAsError();let o=i.getDeepFieldValue(r)?.asObject();o&&sa(o,e.inputType)}t.addErrorMessage(o=>ra(o,n,e.inputType.fields.map(s=>s.name)))}function ra(e,t,r){let n=[`Unknown argument \`${e.red(t)}\`.`],i=Wd(t,r);return i&&n.push(`Did you mean \`${e.green(i)}\`?`),r.length>0&&n.push(or(e)),n.join(" ")}function Ld(e,t){let r;t.addErrorMessage(l=>r?.value instanceof G&&r.value.text==="null"?`Argument \`${l.green(o)}\` must not be ${l.red("null")}.`:`Argument \`${l.green(o)}\` is missing.`);let n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(!n)return;let[i,o]=ir(e.argumentPath),s=new nr,a=n.getDeepFieldValue(i)?.asObject();if(a)if(r=a.getField(o),r&&a.removeField(o),e.inputTypes.length===1&&e.inputTypes[0].kind==="object"){for(let l of e.inputTypes[0].fields)s.addField(l.name,l.typeNames.join(" | "));a.addSuggestion(new pe(o,s).makeRequired())}else{let l=e.inputTypes.map(na).join(" | ");a.addSuggestion(new pe(o,l).makeRequired())}}function na(e){return e.kind==="list"?`${na(e.elementType)}[]`:e.name}function $d(e,t){let r=e.argument.name,n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();n&&n.getDeepFieldValue(e.argumentPath)?.markAsError(),t.addErrorMessage(i=>{let o=yn("or",e.argument.typeNames.map(s=>i.green(s)));return`Argument \`${i.bold(r)}\`: Invalid value provided. Expected ${o}, provided ${i.red(e.inferredType)}.`})}function Vd(e,t){let r=e.argument.name,n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();n&&n.getDeepFieldValue(e.argumentPath)?.markAsError(),t.addErrorMessage(i=>{let o=[`Invalid value for argument \`${i.bold(r)}\``];if(e.underlyingError&&o.push(`: ${e.underlyingError}`),o.push("."),e.argument.typeNames.length>0){let s=yn("or",e.argument.typeNames.map(a=>i.green(a)));o.push(` Expected ${s}.`)}return o.join("")})}function qd(e,t){let r=e.argument.name,n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject(),i;if(n){let s=n.getDeepField(e.argumentPath)?.value;s?.markAsError(),s instanceof G&&(i=s.text)}t.addErrorMessage(o=>{let s=["Unable to fit value"];return i&&s.push(o.red(i)),s.push(`into a 64-bit signed integer for field \`${o.bold(r)}\``),s.join(" ")})}function Ud(e,t){let r=e.argumentPath[e.argumentPath.length-1],n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(n){let i=n.getDeepFieldValue(e.argumentPath)?.asObject();i&&sa(i,e.inputType)}t.addErrorMessage(i=>{let o=[`Argument \`${i.bold(r)}\` of type ${i.bold(e.inputType.name)} needs`];return e.constraints.minFieldCount===1?e.constraints.requiredFields?o.push(`${i.green("at least one of")} ${yn("or",e.constraints.requiredFields.map(s=>`\`${i.bold(s)}\``))} arguments.`):o.push(`${i.green("at least one")} argument.`):o.push(`${i.green(`at least ${e.constraints.minFieldCount}`)} arguments.`),o.push(or(i)),o.join(" ")})}function jd(e,t){let r=e.argumentPath[e.argumentPath.length-1],n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject(),i=[];if(n){let o=n.getDeepFieldValue(e.argumentPath)?.asObject();o&&(o.markAsError(),i=Object.keys(o.getFields()))}t.addErrorMessage(o=>{let s=[`Argument \`${o.bold(r)}\` of type ${o.bold(e.inputType.name)} needs`];return e.constraints.minFieldCount===1&&e.constraints.maxFieldCount==1?s.push(`${o.green("exactly one")} argument,`):e.constraints.maxFieldCount==1?s.push(`${o.green("at most one")} argument,`):s.push(`${o.green(`at most ${e.constraints.maxFieldCount}`)} arguments,`),s.push(`but you provided ${yn("and",i.map(a=>o.red(a)))}. Please choose`),e.constraints.maxFieldCount===1?s.push("one."):s.push(`${e.constraints.maxFieldCount}.`),s.join(" ")})}function ia(e,t){for(let r of t.fields)e.hasField(r.name)||e.addSuggestion(new pe(r.name,"true"))}function Bd(e,t){for(let r of t.fields)r.isRelation&&!e.hasField(r.name)&&e.addSuggestion(new pe(r.name,"true"))}function Qd(e,t){for(let r of t.fields)!e.hasField(r.name)&&!r.isRelation&&e.addSuggestion(new pe(r.name,"true"))}function Hd(e,t){for(let r of t)e.hasField(r.name)||e.addSuggestion(new pe(r.name,r.typeNames.join(" | ")))}function oa(e,t){let[r,n]=ir(e),i=t.arguments.getDeepSubSelectionValue(r)?.asObject();if(!i)return{parentKind:"unknown",fieldName:n};let o=i.getFieldValue("select")?.asObject(),s=i.getFieldValue("include")?.asObject(),a=i.getFieldValue("omit")?.asObject(),l=o?.getField(n);return o&&l?{parentKind:"select",parent:o,field:l,fieldName:n}:(l=s?.getField(n),s&&l?{parentKind:"include",field:l,parent:s,fieldName:n}:(l=a?.getField(n),a&&l?{parentKind:"omit",field:l,parent:a,fieldName:n}:{parentKind:"unknown",fieldName:n}))}function sa(e,t){if(t.kind==="object")for(let r of t.fields)e.hasField(r.name)||e.addSuggestion(new pe(r.name,r.typeNames.join(" | ")))}function ir(e){let t=[...e],r=t.pop();if(!r)throw new Error("unexpected empty path");return[t,r]}function or({green:e,enabled:t}){return"Available options are "+(t?`listed in ${e("green")}`:"marked with ?")+"."}function yn(e,t){if(t.length===1)return t[0];let r=[...t],n=r.pop();return`${r.join(", ")} ${e} ${n}`}var Gd=3;function Wd(e,t){let r=1/0,n;for(let i of t){let o=(0,ta.default)(e,i);o>Gd||o<r&&(r=o,n=i)}return n}var sr=class{modelName;name;typeName;isList;isEnum;constructor(t,r,n,i,o){this.modelName=t,this.name=r,this.typeName=n,this.isList=i,this.isEnum=o}_toGraphQLInputType(){let t=this.isList?"List":"",r=this.isEnum?"Enum":"";return`${t}${r}${this.typeName}FieldRefInput<${this.modelName}>`}};function vt(e){return e instanceof sr}var hn=Symbol(),ki=new WeakMap,De=class{constructor(t){t===hn?ki.set(this,`Prisma.${this._getName()}`):ki.set(this,`new Prisma.${this._getNamespace()}.${this._getName()}()`)}_getName(){return this.constructor.name}toString(){return ki.get(this)}},ar=class extends De{_getNamespace(){return"NullTypes"}},lr=class extends ar{#e};Oi(lr,"DbNull");var ur=class extends ar{#e};Oi(ur,"JsonNull");var cr=class extends ar{#e};Oi(cr,"AnyNull");var wn={classes:{DbNull:lr,JsonNull:ur,AnyNull:cr},instances:{DbNull:new lr(hn),JsonNull:new ur(hn),AnyNull:new cr(hn)}};function Oi(e,t){Object.defineProperty(e,"name",{value:t,configurable:!0})}var aa=": ",En=class{constructor(t,r){this.name=t;this.value=r}hasError=!1;markAsError(){this.hasError=!0}getPrintWidth(){return this.name.length+this.value.getPrintWidth()+aa.length}write(t){let r=new Pe(this.name);this.hasError&&r.underline().setColor(t.context.colors.red),t.write(r).write(aa).write(this.value)}};var Di=class{arguments;errorMessages=[];constructor(t){this.arguments=t}write(t){t.write(this.arguments)}addErrorMessage(t){this.errorMessages.push(t)}renderAllMessages(t){return this.errorMessages.map(r=>r(t)).join(`
21
- `)}};function Tt(e){return new Di(la(e))}function la(e){let t=new Pt;for(let[r,n]of Object.entries(e)){let i=new En(r,ua(n));t.addField(i)}return t}function ua(e){if(typeof e=="string")return new G(JSON.stringify(e));if(typeof e=="number"||typeof e=="boolean")return new G(String(e));if(typeof e=="bigint")return new G(`${e}n`);if(e===null)return new G("null");if(e===void 0)return new G("undefined");if(ht(e))return new G(`new Prisma.Decimal("${e.toFixed()}")`);if(e instanceof Uint8Array)return Buffer.isBuffer(e)?new G(`Buffer.alloc(${e.byteLength})`):new G(`new Uint8Array(${e.byteLength})`);if(e instanceof Date){let t=ln(e)?e.toISOString():"Invalid Date";return new G(`new Date("${t}")`)}return e instanceof De?new G(`Prisma.${e._getName()}`):vt(e)?new G(`prisma.${Ue(e.modelName)}.$fields.${e.name}`):Array.isArray(e)?Jd(e):typeof e=="object"?la(e):new G(Object.prototype.toString.call(e))}function Jd(e){let t=new bt;for(let r of e)t.addItem(ua(r));return t}function xn(e,t){let r=t==="pretty"?ea:gn,n=e.renderAllMessages(r),i=new Et(0,{colors:r}).write(e).toString();return{message:n,args:i}}function bn({args:e,errors:t,errorFormat:r,callsite:n,originalMethod:i,clientVersion:o,globalOmit:s}){let a=Tt(e);for(let p of t)dn(p,a,s);let{message:l,args:u}=xn(a,r),c=pn({message:l,callsite:n,originalMethod:i,showColors:r==="pretty",callArguments:u});throw new ee(c,{clientVersion:o})}function ve(e){return e.replace(/^./,t=>t.toLowerCase())}function pa(e,t,r){let n=ve(r);return!t.result||!(t.result.$allModels||t.result[n])?e:Kd({...e,...ca(t.name,e,t.result.$allModels),...ca(t.name,e,t.result[n])})}function Kd(e){let t=new be,r=(n,i)=>t.getOrCreate(n,()=>i.has(n)?[n]:(i.add(n),e[n]?e[n].needs.flatMap(o=>r(o,i)):[n]));return mt(e,n=>({...n,needs:r(n.name,new Set)}))}function ca(e,t,r){return r?mt(r,({needs:n,compute:i},o)=>({name:o,needs:n?Object.keys(n).filter(s=>n[s]):[],compute:zd(t,o,i)})):{}}function zd(e,t,r){let n=e?.[t]?.compute;return n?i=>r({...i,[t]:n(i)}):r}function da(e,t){if(!t)return e;let r={...e};for(let n of Object.values(t))if(e[n.name])for(let i of n.needs)r[i]=!0;return r}function ma(e,t){if(!t)return e;let r={...e};for(let n of Object.values(t))if(!e[n.name])for(let i of n.needs)delete r[i];return r}var Pn=class{constructor(t,r){this.extension=t;this.previous=r}computedFieldsCache=new be;modelExtensionsCache=new be;queryCallbacksCache=new be;clientExtensions=tr(()=>this.extension.client?{...this.previous?.getAllClientExtensions(),...this.extension.client}:this.previous?.getAllClientExtensions());batchCallbacks=tr(()=>{let t=this.previous?.getAllBatchQueryCallbacks()??[],r=this.extension.query?.$__internalBatch;return r?t.concat(r):t});getAllComputedFields(t){return this.computedFieldsCache.getOrCreate(t,()=>pa(this.previous?.getAllComputedFields(t),this.extension,t))}getAllClientExtensions(){return this.clientExtensions.get()}getAllModelExtensions(t){return this.modelExtensionsCache.getOrCreate(t,()=>{let r=ve(t);return!this.extension.model||!(this.extension.model[r]||this.extension.model.$allModels)?this.previous?.getAllModelExtensions(t):{...this.previous?.getAllModelExtensions(t),...this.extension.model.$allModels,...this.extension.model[r]}})}getAllQueryCallbacks(t,r){return this.queryCallbacksCache.getOrCreate(`${t}:${r}`,()=>{let n=this.previous?.getAllQueryCallbacks(t,r)??[],i=[],o=this.extension.query;return!o||!(o[t]||o.$allModels||o[r]||o.$allOperations)?n:(o[t]!==void 0&&(o[t][r]!==void 0&&i.push(o[t][r]),o[t].$allOperations!==void 0&&i.push(o[t].$allOperations)),t!=="$none"&&o.$allModels!==void 0&&(o.$allModels[r]!==void 0&&i.push(o.$allModels[r]),o.$allModels.$allOperations!==void 0&&i.push(o.$allModels.$allOperations)),o[r]!==void 0&&i.push(o[r]),o.$allOperations!==void 0&&i.push(o.$allOperations),n.concat(i))})}getAllBatchQueryCallbacks(){return this.batchCallbacks.get()}},At=class e{constructor(t){this.head=t}static empty(){return new e}static single(t){return new e(new Pn(t))}isEmpty(){return this.head===void 0}append(t){return new e(new Pn(t,this.head))}getAllComputedFields(t){return this.head?.getAllComputedFields(t)}getAllClientExtensions(){return this.head?.getAllClientExtensions()}getAllModelExtensions(t){return this.head?.getAllModelExtensions(t)}getAllQueryCallbacks(t,r){return this.head?.getAllQueryCallbacks(t,r)??[]}getAllBatchQueryCallbacks(){return this.head?.getAllBatchQueryCallbacks()??[]}};var vn=class{constructor(t){this.name=t}};function fa(e){return e instanceof vn}function ga(e){return new vn(e)}var ya=Symbol(),pr=class{constructor(t){if(t!==ya)throw new Error("Skip instance can not be constructed directly")}ifUndefined(t){return t===void 0?Tn:t}},Tn=new pr(ya);function Te(e){return e instanceof pr}var Yd={findUnique:"findUnique",findUniqueOrThrow:"findUniqueOrThrow",findFirst:"findFirst",findFirstOrThrow:"findFirstOrThrow",findMany:"findMany",count:"aggregate",create:"createOne",createMany:"createMany",createManyAndReturn:"createManyAndReturn",update:"updateOne",updateMany:"updateMany",updateManyAndReturn:"updateManyAndReturn",upsert:"upsertOne",delete:"deleteOne",deleteMany:"deleteMany",executeRaw:"executeRaw",queryRaw:"queryRaw",aggregate:"aggregate",groupBy:"groupBy",runCommandRaw:"runCommandRaw",findRaw:"findRaw",aggregateRaw:"aggregateRaw"},ha="explicitly `undefined` values are not allowed";function An({modelName:e,action:t,args:r,runtimeDataModel:n,extensions:i=At.empty(),callsite:o,clientMethod:s,errorFormat:a,clientVersion:l,previewFeatures:u,globalOmit:c}){let p=new _i({runtimeDataModel:n,modelName:e,action:t,rootArgs:r,callsite:o,extensions:i,selectionPath:[],argumentPath:[],originalMethod:s,errorFormat:a,clientVersion:l,previewFeatures:u,globalOmit:c});return{modelName:e,action:Yd[t],query:dr(r,p)}}function dr({select:e,include:t,...r}={},n){let i=r.omit;return delete r.omit,{arguments:Ea(r,n),selection:Zd(e,t,i,n)}}function Zd(e,t,r,n){return e?(t?n.throwValidationError({kind:"MutuallyExclusiveFields",firstField:"include",secondField:"select",selectionPath:n.getSelectionPath()}):r&&n.throwValidationError({kind:"MutuallyExclusiveFields",firstField:"omit",secondField:"select",selectionPath:n.getSelectionPath()}),rm(e,n)):Xd(n,t,r)}function Xd(e,t,r){let n={};return e.modelOrType&&!e.isRawAction()&&(n.$composites=!0,n.$scalars=!0),t&&em(n,t,e),tm(n,r,e),n}function em(e,t,r){for(let[n,i]of Object.entries(t)){if(Te(i))continue;let o=r.nestSelection(n);if(Ni(i,o),i===!1||i===void 0){e[n]=!1;continue}let s=r.findField(n);if(s&&s.kind!=="object"&&r.throwValidationError({kind:"IncludeOnScalar",selectionPath:r.getSelectionPath().concat(n),outputType:r.getOutputTypeDescription()}),s){e[n]=dr(i===!0?{}:i,o);continue}if(i===!0){e[n]=!0;continue}e[n]=dr(i,o)}}function tm(e,t,r){let n=r.getComputedFields(),i={...r.getGlobalOmit(),...t},o=ma(i,n);for(let[s,a]of Object.entries(o)){if(Te(a))continue;Ni(a,r.nestSelection(s));let l=r.findField(s);n?.[s]&&!l||(e[s]=!a)}}function rm(e,t){let r={},n=t.getComputedFields(),i=da(e,n);for(let[o,s]of Object.entries(i)){if(Te(s))continue;let a=t.nestSelection(o);Ni(s,a);let l=t.findField(o);if(!(n?.[o]&&!l)){if(s===!1||s===void 0||Te(s)){r[o]=!1;continue}if(s===!0){l?.kind==="object"?r[o]=dr({},a):r[o]=!0;continue}r[o]=dr(s,a)}}return r}function wa(e,t){if(e===null)return null;if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return e;if(typeof e=="bigint")return{$type:"BigInt",value:String(e)};if(yt(e)){if(ln(e))return{$type:"DateTime",value:e.toISOString()};t.throwValidationError({kind:"InvalidArgumentValue",selectionPath:t.getSelectionPath(),argumentPath:t.getArgumentPath(),argument:{name:t.getArgumentName(),typeNames:["Date"]},underlyingError:"Provided Date object is invalid"})}if(fa(e))return{$type:"Param",value:e.name};if(vt(e))return{$type:"FieldRef",value:{_ref:e.name,_container:e.modelName}};if(Array.isArray(e))return nm(e,t);if(ArrayBuffer.isView(e)){let{buffer:r,byteOffset:n,byteLength:i}=e;return{$type:"Bytes",value:Buffer.from(r,n,i).toString("base64")}}if(im(e))return e.values;if(ht(e))return{$type:"Decimal",value:e.toFixed()};if(e instanceof De){if(e!==wn.instances[e._getName()])throw new Error("Invalid ObjectEnumValue");return{$type:"Enum",value:e._getName()}}if(om(e))return e.toJSON();if(typeof e=="object")return Ea(e,t);t.throwValidationError({kind:"InvalidArgumentValue",selectionPath:t.getSelectionPath(),argumentPath:t.getArgumentPath(),argument:{name:t.getArgumentName(),typeNames:[]},underlyingError:`We could not serialize ${Object.prototype.toString.call(e)} value. Serialize the object to JSON or implement a ".toJSON()" method on it`})}function Ea(e,t){if(e.$type)return{$type:"Raw",value:e};let r={};for(let n in e){let i=e[n],o=t.nestArgument(n);Te(i)||(i!==void 0?r[n]=wa(i,o):t.isPreviewFeatureOn("strictUndefinedChecks")&&t.throwValidationError({kind:"InvalidArgumentValue",argumentPath:o.getArgumentPath(),selectionPath:t.getSelectionPath(),argument:{name:t.getArgumentName(),typeNames:[]},underlyingError:ha}))}return r}function nm(e,t){let r=[];for(let n=0;n<e.length;n++){let i=t.nestArgument(String(n)),o=e[n];if(o===void 0||Te(o)){let s=o===void 0?"undefined":"Prisma.skip";t.throwValidationError({kind:"InvalidArgumentValue",selectionPath:i.getSelectionPath(),argumentPath:i.getArgumentPath(),argument:{name:`${t.getArgumentName()}[${n}]`,typeNames:[]},underlyingError:`Can not use \`${s}\` value within array. Use \`null\` or filter out \`${s}\` values`})}r.push(wa(o,i))}return r}function im(e){return typeof e=="object"&&e!==null&&e.__prismaRawParameters__===!0}function om(e){return typeof e=="object"&&e!==null&&typeof e.toJSON=="function"}function Ni(e,t){e===void 0&&t.isPreviewFeatureOn("strictUndefinedChecks")&&t.throwValidationError({kind:"InvalidSelectionValue",selectionPath:t.getSelectionPath(),underlyingError:ha})}var _i=class e{constructor(t){this.params=t;this.params.modelName&&(this.modelOrType=this.params.runtimeDataModel.models[this.params.modelName]??this.params.runtimeDataModel.types[this.params.modelName])}modelOrType;throwValidationError(t){bn({errors:[t],originalMethod:this.params.originalMethod,args:this.params.rootArgs??{},callsite:this.params.callsite,errorFormat:this.params.errorFormat,clientVersion:this.params.clientVersion,globalOmit:this.params.globalOmit})}getSelectionPath(){return this.params.selectionPath}getArgumentPath(){return this.params.argumentPath}getArgumentName(){return this.params.argumentPath[this.params.argumentPath.length-1]}getOutputTypeDescription(){if(!(!this.params.modelName||!this.modelOrType))return{name:this.params.modelName,fields:this.modelOrType.fields.map(t=>({name:t.name,typeName:"boolean",isRelation:t.kind==="object"}))}}isRawAction(){return["executeRaw","queryRaw","runCommandRaw","findRaw","aggregateRaw"].includes(this.params.action)}isPreviewFeatureOn(t){return this.params.previewFeatures.includes(t)}getComputedFields(){if(this.params.modelName)return this.params.extensions.getAllComputedFields(this.params.modelName)}findField(t){return this.modelOrType?.fields.find(r=>r.name===t)}nestSelection(t){let r=this.findField(t),n=r?.kind==="object"?r.type:void 0;return new e({...this.params,modelName:n,selectionPath:this.params.selectionPath.concat(t)})}getGlobalOmit(){return this.params.modelName&&this.shouldApplyGlobalOmit()?this.params.globalOmit?.[Ue(this.params.modelName)]??{}:{}}shouldApplyGlobalOmit(){switch(this.params.action){case"findFirst":case"findFirstOrThrow":case"findUniqueOrThrow":case"findMany":case"upsert":case"findUnique":case"createManyAndReturn":case"create":case"update":case"updateManyAndReturn":case"delete":return!0;case"executeRaw":case"aggregateRaw":case"runCommandRaw":case"findRaw":case"createMany":case"deleteMany":case"groupBy":case"updateMany":case"count":case"aggregate":case"queryRaw":return!1;default:fe(this.params.action,"Unknown action")}}nestArgument(t){return new e({...this.params,argumentPath:this.params.argumentPath.concat(t)})}};function xa(e){if(!e._hasPreviewFlag("metrics"))throw new ee("`metrics` preview feature must be enabled in order to access metrics API",{clientVersion:e._clientVersion})}var Ct=class{_client;constructor(t){this._client=t}prometheus(t){return xa(this._client),this._client._engine.metrics({format:"prometheus",...t})}json(t){return xa(this._client),this._client._engine.metrics({format:"json",...t})}};function ba(e,t){let r=tr(()=>sm(t));Object.defineProperty(e,"dmmf",{get:()=>r.get()})}function sm(e){return{datamodel:{models:Mi(e.models),enums:Mi(e.enums),types:Mi(e.types)}}}function Mi(e){return Object.entries(e).map(([t,r])=>({name:t,...r}))}var Fi=new WeakMap,Cn="$$PrismaTypedSql",mr=class{constructor(t,r){Fi.set(this,{sql:t,values:r}),Object.defineProperty(this,Cn,{value:Cn})}get sql(){return Fi.get(this).sql}get values(){return Fi.get(this).values}};function Pa(e){return(...t)=>new mr(e,t)}function Sn(e){return e!=null&&e[Cn]===Cn}var pc=j(va());var dc=require("node:async_hooks"),mc=require("node:events"),fc=j(require("node:fs")),ii=j(require("node:path"));var le=class e{constructor(t,r){if(t.length-1!==r.length)throw t.length===0?new TypeError("Expected at least 1 string"):new TypeError(`Expected ${t.length} strings to have ${t.length-1} values`);let n=r.reduce((s,a)=>s+(a instanceof e?a.values.length:1),0);this.values=new Array(n),this.strings=new Array(n+1),this.strings[0]=t[0];let i=0,o=0;for(;i<r.length;){let s=r[i++],a=t[i];if(s instanceof e){this.strings[o]+=s.strings[0];let l=0;for(;l<s.values.length;)this.values[o++]=s.values[l++],this.strings[o]=s.strings[l];this.strings[o]+=a}else this.values[o++]=s,this.strings[o]=a}}get sql(){let t=this.strings.length,r=1,n=this.strings[0];for(;r<t;)n+=`?${this.strings[r++]}`;return n}get statement(){let t=this.strings.length,r=1,n=this.strings[0];for(;r<t;)n+=`:${r}${this.strings[r++]}`;return n}get text(){let t=this.strings.length,r=1,n=this.strings[0];for(;r<t;)n+=`$${r}${this.strings[r++]}`;return n}inspect(){return{sql:this.sql,statement:this.statement,text:this.text,values:this.values}}};function Ta(e,t=",",r="",n=""){if(e.length===0)throw new TypeError("Expected `join([])` to be called with an array of multiple elements, but got an empty array");return new le([r,...Array(e.length-1).fill(t),n],e)}function Li(e){return new le([e],[])}var Aa=Li("");function $i(e,...t){return new le(e,t)}function fr(e){return{getKeys(){return Object.keys(e)},getPropertyValue(t){return e[t]}}}function ie(e,t){return{getKeys(){return[e]},getPropertyValue(){return t()}}}function Ze(e){let t=new be;return{getKeys(){return e.getKeys()},getPropertyValue(r){return t.getOrCreate(r,()=>e.getPropertyValue(r))},getPropertyDescriptor(r){return e.getPropertyDescriptor?.(r)}}}var Rn={enumerable:!0,configurable:!0,writable:!0};function In(e){let t=new Set(e);return{getPrototypeOf:()=>Object.prototype,getOwnPropertyDescriptor:()=>Rn,has:(r,n)=>t.has(n),set:(r,n,i)=>t.add(n)&&Reflect.set(r,n,i),ownKeys:()=>[...t]}}var Ca=Symbol.for("nodejs.util.inspect.custom");function he(e,t){let r=lm(t),n=new Set,i=new Proxy(e,{get(o,s){if(n.has(s))return o[s];let a=r.get(s);return a?a.getPropertyValue(s):o[s]},has(o,s){if(n.has(s))return!0;let a=r.get(s);return a?a.has?.(s)??!0:Reflect.has(o,s)},ownKeys(o){let s=Sa(Reflect.ownKeys(o),r),a=Sa(Array.from(r.keys()),r);return[...new Set([...s,...a,...n])]},set(o,s,a){return r.get(s)?.getPropertyDescriptor?.(s)?.writable===!1?!1:(n.add(s),Reflect.set(o,s,a))},getOwnPropertyDescriptor(o,s){let a=Reflect.getOwnPropertyDescriptor(o,s);if(a&&!a.configurable)return a;let l=r.get(s);return l?l.getPropertyDescriptor?{...Rn,...l?.getPropertyDescriptor(s)}:Rn:a},defineProperty(o,s,a){return n.add(s),Reflect.defineProperty(o,s,a)},getPrototypeOf:()=>Object.prototype});return i[Ca]=function(){let o={...this};return delete o[Ca],o},i}function lm(e){let t=new Map;for(let r of e){let n=r.getKeys();for(let i of n)t.set(i,r)}return t}function Sa(e,t){return e.filter(r=>t.get(r)?.has?.(r)??!0)}function St(e){return{getKeys(){return e},has(){return!1},getPropertyValue(){}}}function Rt(e,t){return{batch:e,transaction:t?.kind==="batch"?{isolationLevel:t.options.isolationLevel}:void 0}}function Ra(e){if(e===void 0)return"";let t=Tt(e);return new Et(0,{colors:gn}).write(t).toString()}var um="P2037";function kn({error:e,user_facing_error:t},r,n){return t.error_code?new Q(cm(t,n),{code:t.error_code,clientVersion:r,meta:t.meta,batchRequestIdx:t.batch_request_idx}):new X(e,{clientVersion:r,batchRequestIdx:t.batch_request_idx})}function cm(e,t){let r=e.message;return(t==="postgresql"||t==="postgres"||t==="mysql")&&e.error_code===um&&(r+=`
17
+ `)}};var gd={red:Re,gray:Ht,dim:Je,bold:re,underline:se,highlightSource:e=>e.highlight()},hd={red:e=>e,gray:e=>e,dim:e=>e,bold:e=>e,underline:e=>e,highlightSource:e=>e};function yd({message:e,originalMethod:t,isPanic:r,callArguments:n}){return{functionName:`prisma.${t}()`,message:e,isPanic:r??!1,callArguments:n}}function wd({callsite:e,message:t,originalMethod:r,isPanic:n,callArguments:i},o){let s=yd({message:t,originalMethod:r,isPanic:n,callArguments:i});if(!e||typeof window<"u"||process.env.NODE_ENV==="production")return s;let a=e.getLocation();if(!a||!a.lineNumber||!a.columnNumber)return s;let l=Math.max(1,a.lineNumber-3),u=cn.read(a.fileName)?.slice(l,a.lineNumber),c=u?.lineAt(a.lineNumber);if(u&&c){let p=xd(c),d=Ed(c);if(!d)return s;s.functionName=`${d.code})`,s.location=a,n||(u=u.mapLineAt(a.lineNumber,g=>g.slice(0,d.openingBraceIndex))),u=o.highlightSource(u);let f=String(u.lastLineNumber).length;if(s.contextLines=u.mapLines((g,h)=>o.gray(String(h).padStart(f))+" "+g).mapLines(g=>o.dim(g)).prependSymbolAt(a.lineNumber,o.bold(o.red("\u2192"))),i){let g=p+f+1;g+=2,s.callArguments=(0,Gs.default)(i,g).slice(g)}}return s}function Ed(e){let t=Object.keys(wt).join("|"),n=new RegExp(String.raw`\.(${t})\(`).exec(e);if(n){let i=n.index+n[0].length,o=e.lastIndexOf(" ",n.index)+1;return{code:e.slice(o,i),openingBraceIndex:i}}return null}function xd(e){let t=0;for(let r=0;r<e.length;r++){if(e.charAt(r)!==" ")return t;t++}return t}function bd({functionName:e,location:t,message:r,isPanic:n,contextLines:i,callArguments:o},s){let a=[""],l=t?" in":":";if(n?(a.push(s.red(`Oops, an unknown error occurred! This is ${s.bold("on us")}, you did nothing wrong.`)),a.push(s.red(`It occurred in the ${s.bold(`\`${e}\``)} invocation${l}`))):a.push(s.red(`Invalid ${s.bold(`\`${e}\``)} invocation${l}`)),t&&a.push(s.underline(Pd(t))),i){a.push("");let u=[i.toString()];o&&(u.push(o),u.push(s.dim(")"))),a.push(u.join("")),o&&a.push("")}else a.push(""),o&&a.push(o),a.push("");return a.push(r),a.join(`
18
+ `)}function Pd(e){let t=[e.fileName];return e.lineNumber&&t.push(String(e.lineNumber)),e.columnNumber&&t.push(String(e.columnNumber)),t.join(":")}function pn(e){let t=e.showColors?gd:hd,r;return r=wd(e,t),bd(r,t)}var ta=j(Ri());function zs(e,t,r){let n=Ys(e),i=vd(n),o=Ad(i);o?dn(o,t,r):t.addErrorMessage(()=>"Unknown error")}function Ys(e){return e.errors.flatMap(t=>t.kind==="Union"?Ys(t):[t])}function vd(e){let t=new Map,r=[];for(let n of e){if(n.kind!=="InvalidArgumentType"){r.push(n);continue}let i=`${n.selectionPath.join(".")}:${n.argumentPath.join(".")}`,o=t.get(i);o?t.set(i,{...n,argument:{...n.argument,typeNames:Td(o.argument.typeNames,n.argument.typeNames)}}):t.set(i,n)}return r.push(...t.values()),r}function Td(e,t){return[...new Set(e.concat(t))]}function Ad(e){return bi(e,(t,r)=>{let n=Js(t),i=Js(r);return n!==i?n-i:Ks(t)-Ks(r)})}function Js(e){let t=0;return Array.isArray(e.selectionPath)&&(t+=e.selectionPath.length),Array.isArray(e.argumentPath)&&(t+=e.argumentPath.length),t}function Ks(e){switch(e.kind){case"InvalidArgumentValue":case"ValueTooLarge":return 20;case"InvalidArgumentType":return 10;case"RequiredArgumentMissing":return-10;default:return 0}}var pe=class{constructor(t,r){this.name=t;this.value=r}isRequired=!1;makeRequired(){return this.isRequired=!0,this}write(t){let{colors:{green:r}}=t.context;t.addMarginSymbol(r(this.isRequired?"+":"?")),t.write(r(this.name)),this.isRequired||t.write(r("?")),t.write(r(": ")),typeof this.value=="string"?t.write(r(this.value)):t.write(this.value)}};Xs();var Et=class{constructor(t=0,r){this.context=r;this.currentIndent=t}lines=[];currentLine="";currentIndent=0;marginSymbol;afterNextNewLineCallback;write(t){return typeof t=="string"?this.currentLine+=t:t.write(this),this}writeJoined(t,r,n=(i,o)=>o.write(i)){let i=r.length-1;for(let o=0;o<r.length;o++)n(r[o],this),o!==i&&this.write(t);return this}writeLine(t){return this.write(t).newLine()}newLine(){this.lines.push(this.indentedCurrentLine()),this.currentLine="",this.marginSymbol=void 0;let t=this.afterNextNewLineCallback;return this.afterNextNewLineCallback=void 0,t?.(),this}withIndent(t){return this.indent(),t(this),this.unindent(),this}afterNextNewline(t){return this.afterNextNewLineCallback=t,this}indent(){return this.currentIndent++,this}unindent(){return this.currentIndent>0&&this.currentIndent--,this}addMarginSymbol(t){return this.marginSymbol=t,this}toString(){return this.lines.concat(this.indentedCurrentLine()).join(`
19
+ `)}getCurrentLineLength(){return this.currentLine.length}indentedCurrentLine(){let t=this.currentLine.padStart(this.currentLine.length+2*this.currentIndent);return this.marginSymbol?this.marginSymbol+t.slice(1):t}};Zs();var mn=class{constructor(t){this.value=t}write(t){t.write(this.value)}markAsError(){this.value.markAsError()}};var fn=e=>e,gn={bold:fn,red:fn,green:fn,dim:fn,enabled:!1},ea={bold:re,red:Re,green:Qt,dim:Je,enabled:!0},xt={write(e){e.writeLine(",")}};var Pe=class{constructor(t){this.contents=t}isUnderlined=!1;color=t=>t;underline(){return this.isUnderlined=!0,this}setColor(t){return this.color=t,this}write(t){let r=t.getCurrentLineLength();t.write(this.color(this.contents)),this.isUnderlined&&t.afterNextNewline(()=>{t.write(" ".repeat(r)).writeLine(this.color("~".repeat(this.contents.length)))})}};var je=class{hasError=!1;markAsError(){return this.hasError=!0,this}};var bt=class extends je{items=[];addItem(t){return this.items.push(new mn(t)),this}getField(t){return this.items[t]}getPrintWidth(){return this.items.length===0?2:Math.max(...this.items.map(r=>r.value.getPrintWidth()))+2}write(t){if(this.items.length===0){this.writeEmpty(t);return}this.writeWithItems(t)}writeEmpty(t){let r=new Pe("[]");this.hasError&&r.setColor(t.context.colors.red).underline(),t.write(r)}writeWithItems(t){let{colors:r}=t.context;t.writeLine("[").withIndent(()=>t.writeJoined(xt,this.items).newLine()).write("]"),this.hasError&&t.afterNextNewline(()=>{t.writeLine(r.red("~".repeat(this.getPrintWidth())))})}asObject(){}};var Pt=class e extends je{fields={};suggestions=[];addField(t){this.fields[t.name]=t}addSuggestion(t){this.suggestions.push(t)}getField(t){return this.fields[t]}getDeepField(t){let[r,...n]=t,i=this.getField(r);if(!i)return;let o=i;for(let s of n){let a;if(o.value instanceof e?a=o.value.getField(s):o.value instanceof bt&&(a=o.value.getField(Number(s))),!a)return;o=a}return o}getDeepFieldValue(t){return t.length===0?this:this.getDeepField(t)?.value}hasField(t){return!!this.getField(t)}removeAllFields(){this.fields={}}removeField(t){delete this.fields[t]}getFields(){return this.fields}isEmpty(){return Object.keys(this.fields).length===0}getFieldValue(t){return this.getField(t)?.value}getDeepSubSelectionValue(t){let r=this;for(let n of t){if(!(r instanceof e))return;let i=r.getSubSelectionValue(n);if(!i)return;r=i}return r}getDeepSelectionParent(t){let r=this.getSelectionParent();if(!r)return;let n=r;for(let i of t){let o=n.value.getFieldValue(i);if(!o||!(o instanceof e))return;let s=o.getSelectionParent();if(!s)return;n=s}return n}getSelectionParent(){let t=this.getField("select")?.value.asObject();if(t)return{kind:"select",value:t};let r=this.getField("include")?.value.asObject();if(r)return{kind:"include",value:r}}getSubSelectionValue(t){return this.getSelectionParent()?.value.fields[t].value}getPrintWidth(){let t=Object.values(this.fields);return t.length==0?2:Math.max(...t.map(n=>n.getPrintWidth()))+2}write(t){let r=Object.values(this.fields);if(r.length===0&&this.suggestions.length===0){this.writeEmpty(t);return}this.writeWithContents(t,r)}asObject(){return this}writeEmpty(t){let r=new Pe("{}");this.hasError&&r.setColor(t.context.colors.red).underline(),t.write(r)}writeWithContents(t,r){t.writeLine("{").withIndent(()=>{t.writeJoined(xt,[...r,...this.suggestions]).newLine()}),t.write("}"),this.hasError&&t.afterNextNewline(()=>{t.writeLine(t.context.colors.red("~".repeat(this.getPrintWidth())))})}};var G=class extends je{constructor(r){super();this.text=r}getPrintWidth(){return this.text.length}write(r){let n=new Pe(this.text);this.hasError&&n.underline().setColor(r.context.colors.red),r.write(n)}asObject(){}};var nr=class{fields=[];addField(t,r){return this.fields.push({write(n){let{green:i,dim:o}=n.context.colors;n.write(i(o(`${t}: ${r}`))).addMarginSymbol(i(o("+")))}}),this}write(t){let{colors:{green:r}}=t.context;t.writeLine(r("{")).withIndent(()=>{t.writeJoined(xt,this.fields).newLine()}).write(r("}")).addMarginSymbol(r("+"))}};function dn(e,t,r){switch(e.kind){case"MutuallyExclusiveFields":Cd(e,t);break;case"IncludeOnScalar":Sd(e,t);break;case"EmptySelection":Rd(e,t,r);break;case"UnknownSelectionField":Dd(e,t);break;case"InvalidSelectionValue":_d(e,t);break;case"UnknownArgument":Nd(e,t);break;case"UnknownInputField":Md(e,t);break;case"RequiredArgumentMissing":Fd(e,t);break;case"InvalidArgumentType":Ld(e,t);break;case"InvalidArgumentValue":$d(e,t);break;case"ValueTooLarge":Vd(e,t);break;case"SomeFieldsMissing":qd(e,t);break;case"TooManyFieldsGiven":Ud(e,t);break;case"Union":zs(e,t,r);break;default:throw new Error("not implemented: "+e.kind)}}function Cd(e,t){let r=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();r&&(r.getField(e.firstField)?.markAsError(),r.getField(e.secondField)?.markAsError()),t.addErrorMessage(n=>`Please ${n.bold("either")} use ${n.green(`\`${e.firstField}\``)} or ${n.green(`\`${e.secondField}\``)}, but ${n.red("not both")} at the same time.`)}function Sd(e,t){let[r,n]=ir(e.selectionPath),i=e.outputType,o=t.arguments.getDeepSelectionParent(r)?.value;if(o&&(o.getField(n)?.markAsError(),i))for(let s of i.fields)s.isRelation&&o.addSuggestion(new pe(s.name,"true"));t.addErrorMessage(s=>{let a=`Invalid scalar field ${s.red(`\`${n}\``)} for ${s.bold("include")} statement`;return i?a+=` on model ${s.bold(i.name)}. ${or(s)}`:a+=".",a+=`
20
+ Note that ${s.bold("include")} statements only accept relation fields.`,a})}function Rd(e,t,r){let n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(n){let i=n.getField("omit")?.value.asObject();if(i){Id(e,t,i);return}if(n.hasField("select")){kd(e,t);return}}if(r?.[Ue(e.outputType.name)]){Od(e,t);return}t.addErrorMessage(()=>`Unknown field at "${e.selectionPath.join(".")} selection"`)}function Id(e,t,r){r.removeAllFields();for(let n of e.outputType.fields)r.addSuggestion(new pe(n.name,"false"));t.addErrorMessage(n=>`The ${n.red("omit")} statement includes every field of the model ${n.bold(e.outputType.name)}. At least one field must be included in the result`)}function kd(e,t){let r=e.outputType,n=t.arguments.getDeepSelectionParent(e.selectionPath)?.value,i=n?.isEmpty()??!1;n&&(n.removeAllFields(),ia(n,r)),t.addErrorMessage(o=>i?`The ${o.red("`select`")} statement for type ${o.bold(r.name)} must not be empty. ${or(o)}`:`The ${o.red("`select`")} statement for type ${o.bold(r.name)} needs ${o.bold("at least one truthy value")}.`)}function Od(e,t){let r=new nr;for(let i of e.outputType.fields)i.isRelation||r.addField(i.name,"false");let n=new pe("omit",r).makeRequired();if(e.selectionPath.length===0)t.arguments.addSuggestion(n);else{let[i,o]=ir(e.selectionPath),a=t.arguments.getDeepSelectionParent(i)?.value.asObject()?.getField(o);if(a){let l=a?.value.asObject()??new Pt;l.addSuggestion(n),a.value=l}}t.addErrorMessage(i=>`The global ${i.red("omit")} configuration excludes every field of the model ${i.bold(e.outputType.name)}. At least one field must be included in the result`)}function Dd(e,t){let r=oa(e.selectionPath,t);if(r.parentKind!=="unknown"){r.field.markAsError();let n=r.parent;switch(r.parentKind){case"select":ia(n,e.outputType);break;case"include":jd(n,e.outputType);break;case"omit":Bd(n,e.outputType);break}}t.addErrorMessage(n=>{let i=[`Unknown field ${n.red(`\`${r.fieldName}\``)}`];return r.parentKind!=="unknown"&&i.push(`for ${n.bold(r.parentKind)} statement`),i.push(`on model ${n.bold(`\`${e.outputType.name}\``)}.`),i.push(or(n)),i.join(" ")})}function _d(e,t){let r=oa(e.selectionPath,t);r.parentKind!=="unknown"&&r.field.value.markAsError(),t.addErrorMessage(n=>`Invalid value for selection field \`${n.red(r.fieldName)}\`: ${e.underlyingError}`)}function Nd(e,t){let r=e.argumentPath[0],n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();n&&(n.getField(r)?.markAsError(),Qd(n,e.arguments)),t.addErrorMessage(i=>ra(i,r,e.arguments.map(o=>o.name)))}function Md(e,t){let[r,n]=ir(e.argumentPath),i=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(i){i.getDeepField(e.argumentPath)?.markAsError();let o=i.getDeepFieldValue(r)?.asObject();o&&sa(o,e.inputType)}t.addErrorMessage(o=>ra(o,n,e.inputType.fields.map(s=>s.name)))}function ra(e,t,r){let n=[`Unknown argument \`${e.red(t)}\`.`],i=Gd(t,r);return i&&n.push(`Did you mean \`${e.green(i)}\`?`),r.length>0&&n.push(or(e)),n.join(" ")}function Fd(e,t){let r;t.addErrorMessage(l=>r?.value instanceof G&&r.value.text==="null"?`Argument \`${l.green(o)}\` must not be ${l.red("null")}.`:`Argument \`${l.green(o)}\` is missing.`);let n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(!n)return;let[i,o]=ir(e.argumentPath),s=new nr,a=n.getDeepFieldValue(i)?.asObject();if(a)if(r=a.getField(o),r&&a.removeField(o),e.inputTypes.length===1&&e.inputTypes[0].kind==="object"){for(let l of e.inputTypes[0].fields)s.addField(l.name,l.typeNames.join(" | "));a.addSuggestion(new pe(o,s).makeRequired())}else{let l=e.inputTypes.map(na).join(" | ");a.addSuggestion(new pe(o,l).makeRequired())}}function na(e){return e.kind==="list"?`${na(e.elementType)}[]`:e.name}function Ld(e,t){let r=e.argument.name,n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();n&&n.getDeepFieldValue(e.argumentPath)?.markAsError(),t.addErrorMessage(i=>{let o=hn("or",e.argument.typeNames.map(s=>i.green(s)));return`Argument \`${i.bold(r)}\`: Invalid value provided. Expected ${o}, provided ${i.red(e.inferredType)}.`})}function $d(e,t){let r=e.argument.name,n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();n&&n.getDeepFieldValue(e.argumentPath)?.markAsError(),t.addErrorMessage(i=>{let o=[`Invalid value for argument \`${i.bold(r)}\``];if(e.underlyingError&&o.push(`: ${e.underlyingError}`),o.push("."),e.argument.typeNames.length>0){let s=hn("or",e.argument.typeNames.map(a=>i.green(a)));o.push(` Expected ${s}.`)}return o.join("")})}function Vd(e,t){let r=e.argument.name,n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject(),i;if(n){let s=n.getDeepField(e.argumentPath)?.value;s?.markAsError(),s instanceof G&&(i=s.text)}t.addErrorMessage(o=>{let s=["Unable to fit value"];return i&&s.push(o.red(i)),s.push(`into a 64-bit signed integer for field \`${o.bold(r)}\``),s.join(" ")})}function qd(e,t){let r=e.argumentPath[e.argumentPath.length-1],n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(n){let i=n.getDeepFieldValue(e.argumentPath)?.asObject();i&&sa(i,e.inputType)}t.addErrorMessage(i=>{let o=[`Argument \`${i.bold(r)}\` of type ${i.bold(e.inputType.name)} needs`];return e.constraints.minFieldCount===1?e.constraints.requiredFields?o.push(`${i.green("at least one of")} ${hn("or",e.constraints.requiredFields.map(s=>`\`${i.bold(s)}\``))} arguments.`):o.push(`${i.green("at least one")} argument.`):o.push(`${i.green(`at least ${e.constraints.minFieldCount}`)} arguments.`),o.push(or(i)),o.join(" ")})}function Ud(e,t){let r=e.argumentPath[e.argumentPath.length-1],n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject(),i=[];if(n){let o=n.getDeepFieldValue(e.argumentPath)?.asObject();o&&(o.markAsError(),i=Object.keys(o.getFields()))}t.addErrorMessage(o=>{let s=[`Argument \`${o.bold(r)}\` of type ${o.bold(e.inputType.name)} needs`];return e.constraints.minFieldCount===1&&e.constraints.maxFieldCount==1?s.push(`${o.green("exactly one")} argument,`):e.constraints.maxFieldCount==1?s.push(`${o.green("at most one")} argument,`):s.push(`${o.green(`at most ${e.constraints.maxFieldCount}`)} arguments,`),s.push(`but you provided ${hn("and",i.map(a=>o.red(a)))}. Please choose`),e.constraints.maxFieldCount===1?s.push("one."):s.push(`${e.constraints.maxFieldCount}.`),s.join(" ")})}function ia(e,t){for(let r of t.fields)e.hasField(r.name)||e.addSuggestion(new pe(r.name,"true"))}function jd(e,t){for(let r of t.fields)r.isRelation&&!e.hasField(r.name)&&e.addSuggestion(new pe(r.name,"true"))}function Bd(e,t){for(let r of t.fields)!e.hasField(r.name)&&!r.isRelation&&e.addSuggestion(new pe(r.name,"true"))}function Qd(e,t){for(let r of t)e.hasField(r.name)||e.addSuggestion(new pe(r.name,r.typeNames.join(" | ")))}function oa(e,t){let[r,n]=ir(e),i=t.arguments.getDeepSubSelectionValue(r)?.asObject();if(!i)return{parentKind:"unknown",fieldName:n};let o=i.getFieldValue("select")?.asObject(),s=i.getFieldValue("include")?.asObject(),a=i.getFieldValue("omit")?.asObject(),l=o?.getField(n);return o&&l?{parentKind:"select",parent:o,field:l,fieldName:n}:(l=s?.getField(n),s&&l?{parentKind:"include",field:l,parent:s,fieldName:n}:(l=a?.getField(n),a&&l?{parentKind:"omit",field:l,parent:a,fieldName:n}:{parentKind:"unknown",fieldName:n}))}function sa(e,t){if(t.kind==="object")for(let r of t.fields)e.hasField(r.name)||e.addSuggestion(new pe(r.name,r.typeNames.join(" | ")))}function ir(e){let t=[...e],r=t.pop();if(!r)throw new Error("unexpected empty path");return[t,r]}function or({green:e,enabled:t}){return"Available options are "+(t?`listed in ${e("green")}`:"marked with ?")+"."}function hn(e,t){if(t.length===1)return t[0];let r=[...t],n=r.pop();return`${r.join(", ")} ${e} ${n}`}var Hd=3;function Gd(e,t){let r=1/0,n;for(let i of t){let o=(0,ta.default)(e,i);o>Hd||o<r&&(r=o,n=i)}return n}var sr=class{modelName;name;typeName;isList;isEnum;constructor(t,r,n,i,o){this.modelName=t,this.name=r,this.typeName=n,this.isList=i,this.isEnum=o}_toGraphQLInputType(){let t=this.isList?"List":"",r=this.isEnum?"Enum":"";return`${t}${r}${this.typeName}FieldRefInput<${this.modelName}>`}};function vt(e){return e instanceof sr}var yn=Symbol(),ki=new WeakMap,De=class{constructor(t){t===yn?ki.set(this,`Prisma.${this._getName()}`):ki.set(this,`new Prisma.${this._getNamespace()}.${this._getName()}()`)}_getName(){return this.constructor.name}toString(){return ki.get(this)}},ar=class extends De{_getNamespace(){return"NullTypes"}},lr=class extends ar{#e};Oi(lr,"DbNull");var ur=class extends ar{#e};Oi(ur,"JsonNull");var cr=class extends ar{#e};Oi(cr,"AnyNull");var wn={classes:{DbNull:lr,JsonNull:ur,AnyNull:cr},instances:{DbNull:new lr(yn),JsonNull:new ur(yn),AnyNull:new cr(yn)}};function Oi(e,t){Object.defineProperty(e,"name",{value:t,configurable:!0})}var aa=": ",En=class{constructor(t,r){this.name=t;this.value=r}hasError=!1;markAsError(){this.hasError=!0}getPrintWidth(){return this.name.length+this.value.getPrintWidth()+aa.length}write(t){let r=new Pe(this.name);this.hasError&&r.underline().setColor(t.context.colors.red),t.write(r).write(aa).write(this.value)}};var Di=class{arguments;errorMessages=[];constructor(t){this.arguments=t}write(t){t.write(this.arguments)}addErrorMessage(t){this.errorMessages.push(t)}renderAllMessages(t){return this.errorMessages.map(r=>r(t)).join(`
21
+ `)}};function Tt(e){return new Di(la(e))}function la(e){let t=new Pt;for(let[r,n]of Object.entries(e)){let i=new En(r,ua(n));t.addField(i)}return t}function ua(e){if(typeof e=="string")return new G(JSON.stringify(e));if(typeof e=="number"||typeof e=="boolean")return new G(String(e));if(typeof e=="bigint")return new G(`${e}n`);if(e===null)return new G("null");if(e===void 0)return new G("undefined");if(yt(e))return new G(`new Prisma.Decimal("${e.toFixed()}")`);if(e instanceof Uint8Array)return Buffer.isBuffer(e)?new G(`Buffer.alloc(${e.byteLength})`):new G(`new Uint8Array(${e.byteLength})`);if(e instanceof Date){let t=ln(e)?e.toISOString():"Invalid Date";return new G(`new Date("${t}")`)}return e instanceof De?new G(`Prisma.${e._getName()}`):vt(e)?new G(`prisma.${Ue(e.modelName)}.$fields.${e.name}`):Array.isArray(e)?Wd(e):typeof e=="object"?la(e):new G(Object.prototype.toString.call(e))}function Wd(e){let t=new bt;for(let r of e)t.addItem(ua(r));return t}function xn(e,t){let r=t==="pretty"?ea:gn,n=e.renderAllMessages(r),i=new Et(0,{colors:r}).write(e).toString();return{message:n,args:i}}function bn({args:e,errors:t,errorFormat:r,callsite:n,originalMethod:i,clientVersion:o,globalOmit:s}){let a=Tt(e);for(let p of t)dn(p,a,s);let{message:l,args:u}=xn(a,r),c=pn({message:l,callsite:n,originalMethod:i,showColors:r==="pretty",callArguments:u});throw new ee(c,{clientVersion:o})}function ve(e){return e.replace(/^./,t=>t.toLowerCase())}function pa(e,t,r){let n=ve(r);return!t.result||!(t.result.$allModels||t.result[n])?e:Jd({...e,...ca(t.name,e,t.result.$allModels),...ca(t.name,e,t.result[n])})}function Jd(e){let t=new be,r=(n,i)=>t.getOrCreate(n,()=>i.has(n)?[n]:(i.add(n),e[n]?e[n].needs.flatMap(o=>r(o,i)):[n]));return mt(e,n=>({...n,needs:r(n.name,new Set)}))}function ca(e,t,r){return r?mt(r,({needs:n,compute:i},o)=>({name:o,needs:n?Object.keys(n).filter(s=>n[s]):[],compute:Kd(t,o,i)})):{}}function Kd(e,t,r){let n=e?.[t]?.compute;return n?i=>r({...i,[t]:n(i)}):r}function da(e,t){if(!t)return e;let r={...e};for(let n of Object.values(t))if(e[n.name])for(let i of n.needs)r[i]=!0;return r}function ma(e,t){if(!t)return e;let r={...e};for(let n of Object.values(t))if(!e[n.name])for(let i of n.needs)delete r[i];return r}var Pn=class{constructor(t,r){this.extension=t;this.previous=r}computedFieldsCache=new be;modelExtensionsCache=new be;queryCallbacksCache=new be;clientExtensions=tr(()=>this.extension.client?{...this.previous?.getAllClientExtensions(),...this.extension.client}:this.previous?.getAllClientExtensions());batchCallbacks=tr(()=>{let t=this.previous?.getAllBatchQueryCallbacks()??[],r=this.extension.query?.$__internalBatch;return r?t.concat(r):t});getAllComputedFields(t){return this.computedFieldsCache.getOrCreate(t,()=>pa(this.previous?.getAllComputedFields(t),this.extension,t))}getAllClientExtensions(){return this.clientExtensions.get()}getAllModelExtensions(t){return this.modelExtensionsCache.getOrCreate(t,()=>{let r=ve(t);return!this.extension.model||!(this.extension.model[r]||this.extension.model.$allModels)?this.previous?.getAllModelExtensions(t):{...this.previous?.getAllModelExtensions(t),...this.extension.model.$allModels,...this.extension.model[r]}})}getAllQueryCallbacks(t,r){return this.queryCallbacksCache.getOrCreate(`${t}:${r}`,()=>{let n=this.previous?.getAllQueryCallbacks(t,r)??[],i=[],o=this.extension.query;return!o||!(o[t]||o.$allModels||o[r]||o.$allOperations)?n:(o[t]!==void 0&&(o[t][r]!==void 0&&i.push(o[t][r]),o[t].$allOperations!==void 0&&i.push(o[t].$allOperations)),t!=="$none"&&o.$allModels!==void 0&&(o.$allModels[r]!==void 0&&i.push(o.$allModels[r]),o.$allModels.$allOperations!==void 0&&i.push(o.$allModels.$allOperations)),o[r]!==void 0&&i.push(o[r]),o.$allOperations!==void 0&&i.push(o.$allOperations),n.concat(i))})}getAllBatchQueryCallbacks(){return this.batchCallbacks.get()}},At=class e{constructor(t){this.head=t}static empty(){return new e}static single(t){return new e(new Pn(t))}isEmpty(){return this.head===void 0}append(t){return new e(new Pn(t,this.head))}getAllComputedFields(t){return this.head?.getAllComputedFields(t)}getAllClientExtensions(){return this.head?.getAllClientExtensions()}getAllModelExtensions(t){return this.head?.getAllModelExtensions(t)}getAllQueryCallbacks(t,r){return this.head?.getAllQueryCallbacks(t,r)??[]}getAllBatchQueryCallbacks(){return this.head?.getAllBatchQueryCallbacks()??[]}};var vn=class{constructor(t){this.name=t}};function fa(e){return e instanceof vn}function ga(e){return new vn(e)}var ha=Symbol(),pr=class{constructor(t){if(t!==ha)throw new Error("Skip instance can not be constructed directly")}ifUndefined(t){return t===void 0?Tn:t}},Tn=new pr(ha);function Te(e){return e instanceof pr}var zd={findUnique:"findUnique",findUniqueOrThrow:"findUniqueOrThrow",findFirst:"findFirst",findFirstOrThrow:"findFirstOrThrow",findMany:"findMany",count:"aggregate",create:"createOne",createMany:"createMany",createManyAndReturn:"createManyAndReturn",update:"updateOne",updateMany:"updateMany",updateManyAndReturn:"updateManyAndReturn",upsert:"upsertOne",delete:"deleteOne",deleteMany:"deleteMany",executeRaw:"executeRaw",queryRaw:"queryRaw",aggregate:"aggregate",groupBy:"groupBy",runCommandRaw:"runCommandRaw",findRaw:"findRaw",aggregateRaw:"aggregateRaw"},ya="explicitly `undefined` values are not allowed";function An({modelName:e,action:t,args:r,runtimeDataModel:n,extensions:i=At.empty(),callsite:o,clientMethod:s,errorFormat:a,clientVersion:l,previewFeatures:u,globalOmit:c}){let p=new _i({runtimeDataModel:n,modelName:e,action:t,rootArgs:r,callsite:o,extensions:i,selectionPath:[],argumentPath:[],originalMethod:s,errorFormat:a,clientVersion:l,previewFeatures:u,globalOmit:c});return{modelName:e,action:zd[t],query:dr(r,p)}}function dr({select:e,include:t,...r}={},n){let i=r.omit;return delete r.omit,{arguments:Ea(r,n),selection:Yd(e,t,i,n)}}function Yd(e,t,r,n){return e?(t?n.throwValidationError({kind:"MutuallyExclusiveFields",firstField:"include",secondField:"select",selectionPath:n.getSelectionPath()}):r&&n.throwValidationError({kind:"MutuallyExclusiveFields",firstField:"omit",secondField:"select",selectionPath:n.getSelectionPath()}),tm(e,n)):Zd(n,t,r)}function Zd(e,t,r){let n={};return e.modelOrType&&!e.isRawAction()&&(n.$composites=!0,n.$scalars=!0),t&&Xd(n,t,e),em(n,r,e),n}function Xd(e,t,r){for(let[n,i]of Object.entries(t)){if(Te(i))continue;let o=r.nestSelection(n);if(Ni(i,o),i===!1||i===void 0){e[n]=!1;continue}let s=r.findField(n);if(s&&s.kind!=="object"&&r.throwValidationError({kind:"IncludeOnScalar",selectionPath:r.getSelectionPath().concat(n),outputType:r.getOutputTypeDescription()}),s){e[n]=dr(i===!0?{}:i,o);continue}if(i===!0){e[n]=!0;continue}e[n]=dr(i,o)}}function em(e,t,r){let n=r.getComputedFields(),i={...r.getGlobalOmit(),...t},o=ma(i,n);for(let[s,a]of Object.entries(o)){if(Te(a))continue;Ni(a,r.nestSelection(s));let l=r.findField(s);n?.[s]&&!l||(e[s]=!a)}}function tm(e,t){let r={},n=t.getComputedFields(),i=da(e,n);for(let[o,s]of Object.entries(i)){if(Te(s))continue;let a=t.nestSelection(o);Ni(s,a);let l=t.findField(o);if(!(n?.[o]&&!l)){if(s===!1||s===void 0||Te(s)){r[o]=!1;continue}if(s===!0){l?.kind==="object"?r[o]=dr({},a):r[o]=!0;continue}r[o]=dr(s,a)}}return r}function wa(e,t){if(e===null)return null;if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return e;if(typeof e=="bigint")return{$type:"BigInt",value:String(e)};if(ht(e)){if(ln(e))return{$type:"DateTime",value:e.toISOString()};t.throwValidationError({kind:"InvalidArgumentValue",selectionPath:t.getSelectionPath(),argumentPath:t.getArgumentPath(),argument:{name:t.getArgumentName(),typeNames:["Date"]},underlyingError:"Provided Date object is invalid"})}if(fa(e))return{$type:"Param",value:e.name};if(vt(e))return{$type:"FieldRef",value:{_ref:e.name,_container:e.modelName}};if(Array.isArray(e))return rm(e,t);if(ArrayBuffer.isView(e)){let{buffer:r,byteOffset:n,byteLength:i}=e;return{$type:"Bytes",value:Buffer.from(r,n,i).toString("base64")}}if(nm(e))return e.values;if(yt(e))return{$type:"Decimal",value:e.toFixed()};if(e instanceof De){if(e!==wn.instances[e._getName()])throw new Error("Invalid ObjectEnumValue");return{$type:"Enum",value:e._getName()}}if(im(e))return e.toJSON();if(typeof e=="object")return Ea(e,t);t.throwValidationError({kind:"InvalidArgumentValue",selectionPath:t.getSelectionPath(),argumentPath:t.getArgumentPath(),argument:{name:t.getArgumentName(),typeNames:[]},underlyingError:`We could not serialize ${Object.prototype.toString.call(e)} value. Serialize the object to JSON or implement a ".toJSON()" method on it`})}function Ea(e,t){if(e.$type)return{$type:"Raw",value:e};let r={};for(let n in e){let i=e[n],o=t.nestArgument(n);Te(i)||(i!==void 0?r[n]=wa(i,o):t.isPreviewFeatureOn("strictUndefinedChecks")&&t.throwValidationError({kind:"InvalidArgumentValue",argumentPath:o.getArgumentPath(),selectionPath:t.getSelectionPath(),argument:{name:t.getArgumentName(),typeNames:[]},underlyingError:ya}))}return r}function rm(e,t){let r=[];for(let n=0;n<e.length;n++){let i=t.nestArgument(String(n)),o=e[n];if(o===void 0||Te(o)){let s=o===void 0?"undefined":"Prisma.skip";t.throwValidationError({kind:"InvalidArgumentValue",selectionPath:i.getSelectionPath(),argumentPath:i.getArgumentPath(),argument:{name:`${t.getArgumentName()}[${n}]`,typeNames:[]},underlyingError:`Can not use \`${s}\` value within array. Use \`null\` or filter out \`${s}\` values`})}r.push(wa(o,i))}return r}function nm(e){return typeof e=="object"&&e!==null&&e.__prismaRawParameters__===!0}function im(e){return typeof e=="object"&&e!==null&&typeof e.toJSON=="function"}function Ni(e,t){e===void 0&&t.isPreviewFeatureOn("strictUndefinedChecks")&&t.throwValidationError({kind:"InvalidSelectionValue",selectionPath:t.getSelectionPath(),underlyingError:ya})}var _i=class e{constructor(t){this.params=t;this.params.modelName&&(this.modelOrType=this.params.runtimeDataModel.models[this.params.modelName]??this.params.runtimeDataModel.types[this.params.modelName])}modelOrType;throwValidationError(t){bn({errors:[t],originalMethod:this.params.originalMethod,args:this.params.rootArgs??{},callsite:this.params.callsite,errorFormat:this.params.errorFormat,clientVersion:this.params.clientVersion,globalOmit:this.params.globalOmit})}getSelectionPath(){return this.params.selectionPath}getArgumentPath(){return this.params.argumentPath}getArgumentName(){return this.params.argumentPath[this.params.argumentPath.length-1]}getOutputTypeDescription(){if(!(!this.params.modelName||!this.modelOrType))return{name:this.params.modelName,fields:this.modelOrType.fields.map(t=>({name:t.name,typeName:"boolean",isRelation:t.kind==="object"}))}}isRawAction(){return["executeRaw","queryRaw","runCommandRaw","findRaw","aggregateRaw"].includes(this.params.action)}isPreviewFeatureOn(t){return this.params.previewFeatures.includes(t)}getComputedFields(){if(this.params.modelName)return this.params.extensions.getAllComputedFields(this.params.modelName)}findField(t){return this.modelOrType?.fields.find(r=>r.name===t)}nestSelection(t){let r=this.findField(t),n=r?.kind==="object"?r.type:void 0;return new e({...this.params,modelName:n,selectionPath:this.params.selectionPath.concat(t)})}getGlobalOmit(){return this.params.modelName&&this.shouldApplyGlobalOmit()?this.params.globalOmit?.[Ue(this.params.modelName)]??{}:{}}shouldApplyGlobalOmit(){switch(this.params.action){case"findFirst":case"findFirstOrThrow":case"findUniqueOrThrow":case"findMany":case"upsert":case"findUnique":case"createManyAndReturn":case"create":case"update":case"updateManyAndReturn":case"delete":return!0;case"executeRaw":case"aggregateRaw":case"runCommandRaw":case"findRaw":case"createMany":case"deleteMany":case"groupBy":case"updateMany":case"count":case"aggregate":case"queryRaw":return!1;default:fe(this.params.action,"Unknown action")}}nestArgument(t){return new e({...this.params,argumentPath:this.params.argumentPath.concat(t)})}};function xa(e){if(!e._hasPreviewFlag("metrics"))throw new ee("`metrics` preview feature must be enabled in order to access metrics API",{clientVersion:e._clientVersion})}var Ct=class{_client;constructor(t){this._client=t}prometheus(t){return xa(this._client),this._client._engine.metrics({format:"prometheus",...t})}json(t){return xa(this._client),this._client._engine.metrics({format:"json",...t})}};function ba(e,t){let r=tr(()=>om(t));Object.defineProperty(e,"dmmf",{get:()=>r.get()})}function om(e){return{datamodel:{models:Mi(e.models),enums:Mi(e.enums),types:Mi(e.types)}}}function Mi(e){return Object.entries(e).map(([t,r])=>({name:t,...r}))}var Fi=new WeakMap,Cn="$$PrismaTypedSql",mr=class{constructor(t,r){Fi.set(this,{sql:t,values:r}),Object.defineProperty(this,Cn,{value:Cn})}get sql(){return Fi.get(this).sql}get values(){return Fi.get(this).values}};function Pa(e){return(...t)=>new mr(e,t)}function Sn(e){return e!=null&&e[Cn]===Cn}var cc=j(va());var pc=require("node:async_hooks"),dc=require("node:events"),mc=j(require("node:fs")),ii=j(require("node:path"));var le=class e{constructor(t,r){if(t.length-1!==r.length)throw t.length===0?new TypeError("Expected at least 1 string"):new TypeError(`Expected ${t.length} strings to have ${t.length-1} values`);let n=r.reduce((s,a)=>s+(a instanceof e?a.values.length:1),0);this.values=new Array(n),this.strings=new Array(n+1),this.strings[0]=t[0];let i=0,o=0;for(;i<r.length;){let s=r[i++],a=t[i];if(s instanceof e){this.strings[o]+=s.strings[0];let l=0;for(;l<s.values.length;)this.values[o++]=s.values[l++],this.strings[o]=s.strings[l];this.strings[o]+=a}else this.values[o++]=s,this.strings[o]=a}}get sql(){let t=this.strings.length,r=1,n=this.strings[0];for(;r<t;)n+=`?${this.strings[r++]}`;return n}get statement(){let t=this.strings.length,r=1,n=this.strings[0];for(;r<t;)n+=`:${r}${this.strings[r++]}`;return n}get text(){let t=this.strings.length,r=1,n=this.strings[0];for(;r<t;)n+=`$${r}${this.strings[r++]}`;return n}inspect(){return{sql:this.sql,statement:this.statement,text:this.text,values:this.values}}};function Ta(e,t=",",r="",n=""){if(e.length===0)throw new TypeError("Expected `join([])` to be called with an array of multiple elements, but got an empty array");return new le([r,...Array(e.length-1).fill(t),n],e)}function Li(e){return new le([e],[])}var Aa=Li("");function $i(e,...t){return new le(e,t)}function fr(e){return{getKeys(){return Object.keys(e)},getPropertyValue(t){return e[t]}}}function ie(e,t){return{getKeys(){return[e]},getPropertyValue(){return t()}}}function Ze(e){let t=new be;return{getKeys(){return e.getKeys()},getPropertyValue(r){return t.getOrCreate(r,()=>e.getPropertyValue(r))},getPropertyDescriptor(r){return e.getPropertyDescriptor?.(r)}}}var Rn={enumerable:!0,configurable:!0,writable:!0};function In(e){let t=new Set(e);return{getPrototypeOf:()=>Object.prototype,getOwnPropertyDescriptor:()=>Rn,has:(r,n)=>t.has(n),set:(r,n,i)=>t.add(n)&&Reflect.set(r,n,i),ownKeys:()=>[...t]}}var Ca=Symbol.for("nodejs.util.inspect.custom");function ye(e,t){let r=am(t),n=new Set,i=new Proxy(e,{get(o,s){if(n.has(s))return o[s];let a=r.get(s);return a?a.getPropertyValue(s):o[s]},has(o,s){if(n.has(s))return!0;let a=r.get(s);return a?a.has?.(s)??!0:Reflect.has(o,s)},ownKeys(o){let s=Sa(Reflect.ownKeys(o),r),a=Sa(Array.from(r.keys()),r);return[...new Set([...s,...a,...n])]},set(o,s,a){return r.get(s)?.getPropertyDescriptor?.(s)?.writable===!1?!1:(n.add(s),Reflect.set(o,s,a))},getOwnPropertyDescriptor(o,s){let a=Reflect.getOwnPropertyDescriptor(o,s);if(a&&!a.configurable)return a;let l=r.get(s);return l?l.getPropertyDescriptor?{...Rn,...l?.getPropertyDescriptor(s)}:Rn:a},defineProperty(o,s,a){return n.add(s),Reflect.defineProperty(o,s,a)},getPrototypeOf:()=>Object.prototype});return i[Ca]=function(){let o={...this};return delete o[Ca],o},i}function am(e){let t=new Map;for(let r of e){let n=r.getKeys();for(let i of n)t.set(i,r)}return t}function Sa(e,t){return e.filter(r=>t.get(r)?.has?.(r)??!0)}function St(e){return{getKeys(){return e},has(){return!1},getPropertyValue(){}}}function Rt(e,t){return{batch:e,transaction:t?.kind==="batch"?{isolationLevel:t.options.isolationLevel}:void 0}}function Ra(e){if(e===void 0)return"";let t=Tt(e);return new Et(0,{colors:gn}).write(t).toString()}var lm="P2037";function kn({error:e,user_facing_error:t},r,n){return t.error_code?new Q(um(t,n),{code:t.error_code,clientVersion:r,meta:t.meta,batchRequestIdx:t.batch_request_idx}):new X(e,{clientVersion:r,batchRequestIdx:t.batch_request_idx})}function um(e,t){let r=e.message;return(t==="postgresql"||t==="postgres"||t==="mysql")&&e.error_code===lm&&(r+=`
22
22
  Prisma Accelerate has built-in connection pooling to prevent such errors: https://pris.ly/client/error-accelerate`),r}var gr="<unknown>";function Ia(e){var t=e.split(`
23
- `);return t.reduce(function(r,n){var i=mm(n)||gm(n)||wm(n)||Pm(n)||xm(n);return i&&r.push(i),r},[])}var pm=/^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|rsc|<anonymous>|\/|[a-z]:\\|\\\\).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,dm=/\((\S*)(?::(\d+))(?::(\d+))\)/;function mm(e){var t=pm.exec(e);if(!t)return null;var r=t[2]&&t[2].indexOf("native")===0,n=t[2]&&t[2].indexOf("eval")===0,i=dm.exec(t[2]);return n&&i!=null&&(t[2]=i[1],t[3]=i[2],t[4]=i[3]),{file:r?null:t[2],methodName:t[1]||gr,arguments:r?[t[2]]:[],lineNumber:t[3]?+t[3]:null,column:t[4]?+t[4]:null}}var fm=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|rsc|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;function gm(e){var t=fm.exec(e);return t?{file:t[2],methodName:t[1]||gr,arguments:[],lineNumber:+t[3],column:t[4]?+t[4]:null}:null}var ym=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|rsc|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,hm=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;function wm(e){var t=ym.exec(e);if(!t)return null;var r=t[3]&&t[3].indexOf(" > eval")>-1,n=hm.exec(t[3]);return r&&n!=null&&(t[3]=n[1],t[4]=n[2],t[5]=null),{file:t[3],methodName:t[1]||gr,arguments:t[2]?t[2].split(","):[],lineNumber:t[4]?+t[4]:null,column:t[5]?+t[5]:null}}var Em=/^\s*(?:([^@]*)(?:\((.*?)\))?@)?(\S.*?):(\d+)(?::(\d+))?\s*$/i;function xm(e){var t=Em.exec(e);return t?{file:t[3],methodName:t[1]||gr,arguments:[],lineNumber:+t[4],column:t[5]?+t[5]:null}:null}var bm=/^\s*at (?:((?:\[object object\])?[^\\/]+(?: \[as \S+\])?) )?\(?(.*?):(\d+)(?::(\d+))?\)?\s*$/i;function Pm(e){var t=bm.exec(e);return t?{file:t[2],methodName:t[1]||gr,arguments:[],lineNumber:+t[3],column:t[4]?+t[4]:null}:null}var Vi=class{getLocation(){return null}},qi=class{_error;constructor(){this._error=new Error}getLocation(){let t=this._error.stack;if(!t)return null;let n=Ia(t).find(i=>{if(!i.file)return!1;let o=gi(i.file);return o!=="<anonymous>"&&!o.includes("@prisma")&&!o.includes("/packages/client/src/runtime/")&&!o.endsWith("/runtime/binary.js")&&!o.endsWith("/runtime/library.js")&&!o.endsWith("/runtime/edge.js")&&!o.endsWith("/runtime/edge-esm.js")&&!o.startsWith("internal/")&&!i.methodName.includes("new ")&&!i.methodName.includes("getCallSite")&&!i.methodName.includes("Proxy.")&&i.methodName.split(".").length<4});return!n||!n.file?null:{fileName:n.file,lineNumber:n.lineNumber,columnNumber:n.column}}};function Be(e){return e==="minimal"?typeof $EnabledCallSite=="function"&&e!=="minimal"?new $EnabledCallSite:new Vi:new qi}var ka={_avg:!0,_count:!0,_sum:!0,_min:!0,_max:!0};function It(e={}){let t=Tm(e);return Object.entries(t).reduce((n,[i,o])=>(ka[i]!==void 0?n.select[i]={select:o}:n[i]=o,n),{select:{}})}function Tm(e={}){return typeof e._count=="boolean"?{...e,_count:{_all:e._count}}:e}function On(e={}){return t=>(typeof e._count=="boolean"&&(t._count=t._count._all),t)}function Oa(e,t){let r=On(e);return t({action:"aggregate",unpacker:r,argsMapper:It})(e)}function Am(e={}){let{select:t,...r}=e;return typeof t=="object"?It({...r,_count:t}):It({...r,_count:{_all:!0}})}function Cm(e={}){return typeof e.select=="object"?t=>On(e)(t)._count:t=>On(e)(t)._count._all}function Da(e,t){return t({action:"count",unpacker:Cm(e),argsMapper:Am})(e)}function Sm(e={}){let t=It(e);if(Array.isArray(t.by))for(let r of t.by)typeof r=="string"&&(t.select[r]=!0);else typeof t.by=="string"&&(t.select[t.by]=!0);return t}function Rm(e={}){return t=>(typeof e?._count=="boolean"&&t.forEach(r=>{r._count=r._count._all}),t)}function _a(e,t){return t({action:"groupBy",unpacker:Rm(e),argsMapper:Sm})(e)}function Na(e,t,r){if(t==="aggregate")return n=>Oa(n,r);if(t==="count")return n=>Da(n,r);if(t==="groupBy")return n=>_a(n,r)}function Ma(e,t){let r=t.fields.filter(i=>!i.relationName),n=qs(r,"name");return new Proxy({},{get(i,o){if(o in i||typeof o=="symbol")return i[o];let s=n[o];if(s)return new sr(e,o,s.type,s.isList,s.kind==="enum")},...In(Object.keys(n))})}var Fa=e=>Array.isArray(e)?e:e.split("."),Ui=(e,t)=>Fa(t).reduce((r,n)=>r&&r[n],e),La=(e,t,r)=>Fa(t).reduceRight((n,i,o,s)=>Object.assign({},Ui(e,s.slice(0,o)),{[i]:n}),r);function Im(e,t){return e===void 0||t===void 0?[]:[...t,"select",e]}function km(e,t,r){return t===void 0?e??{}:La(t,r,e||!0)}function ji(e,t,r,n,i,o){let a=e._runtimeDataModel.models[t].fields.reduce((l,u)=>({...l,[u.name]:u}),{});return l=>{let u=Be(e._errorFormat),c=Im(n,i),p=km(l,o,c),d=r({dataPath:c,callsite:u})(p),m=Om(e,t);return new Proxy(d,{get(g,y){if(!m.includes(y))return g[y];let A=[a[y].type,r,y],C=[c,p];return ji(e,...A,...C)},...In([...m,...Object.getOwnPropertyNames(d)])})}}function Om(e,t){return e._runtimeDataModel.models[t].fields.filter(r=>r.kind==="object").map(r=>r.name)}var Dm=["findUnique","findUniqueOrThrow","findFirst","findFirstOrThrow","create","update","upsert","delete"],_m=["aggregate","count","groupBy"];function Bi(e,t){let r=e._extensions.getAllModelExtensions(t)??{},n=[Nm(e,t),Fm(e,t),fr(r),ie("name",()=>t),ie("$name",()=>t),ie("$parent",()=>e._appliedParent)];return he({},n)}function Nm(e,t){let r=ve(t),n=Object.keys(wt).concat("count");return{getKeys(){return n},getPropertyValue(i){let o=i,s=a=>l=>{let u=Be(e._errorFormat);return e._createPrismaPromise(c=>{let p={args:l,dataPath:[],action:o,model:t,clientMethod:`${r}.${i}`,jsModelName:r,transaction:c,callsite:u};return e._request({...p,...a})},{action:o,args:l,model:t})};return Dm.includes(o)?ji(e,t,s):Mm(i)?Na(e,i,s):s({})}}}function Mm(e){return _m.includes(e)}function Fm(e,t){return Ze(ie("fields",()=>{let r=e._runtimeDataModel.models[t];return Ma(t,r)}))}function $a(e){return e.replace(/^./,t=>t.toUpperCase())}var Qi=Symbol();function yr(e){let t=[Lm(e),$m(e),ie(Qi,()=>e),ie("$parent",()=>e._appliedParent)],r=e._extensions.getAllClientExtensions();return r&&t.push(fr(r)),he(e,t)}function Lm(e){let t=Object.getPrototypeOf(e._originalClient),r=[...new Set(Object.getOwnPropertyNames(t))];return{getKeys(){return r},getPropertyValue(n){return e[n]}}}function $m(e){let t=Object.keys(e._runtimeDataModel.models),r=t.map(ve),n=[...new Set(t.concat(r))];return Ze({getKeys(){return n},getPropertyValue(i){let o=$a(i);if(e._runtimeDataModel.models[o]!==void 0)return Bi(e,o);if(e._runtimeDataModel.models[i]!==void 0)return Bi(e,i)},getPropertyDescriptor(i){if(!r.includes(i))return{enumerable:!1}}})}function Va(e){return e[Qi]?e[Qi]:e}function qa(e){if(typeof e=="function")return e(this);if(e.client?.__AccelerateEngine){let r=e.client.__AccelerateEngine;this._originalClient._engine=new r(this._originalClient._accelerateEngineConfig)}let t=Object.create(this._originalClient,{_extensions:{value:this._extensions.append(e)},_appliedParent:{value:this,configurable:!0},$use:{value:void 0},$on:{value:void 0}});return yr(t)}function Ua({result:e,modelName:t,select:r,omit:n,extensions:i}){let o=i.getAllComputedFields(t);if(!o)return e;let s=[],a=[];for(let l of Object.values(o)){if(n){if(n[l.name])continue;let u=l.needs.filter(c=>n[c]);u.length>0&&a.push(St(u))}else if(r){if(!r[l.name])continue;let u=l.needs.filter(c=>!r[c]);u.length>0&&a.push(St(u))}Vm(e,l.needs)&&s.push(qm(l,he(e,s)))}return s.length>0||a.length>0?he(e,[...s,...a]):e}function Vm(e,t){return t.every(r=>xi(e,r))}function qm(e,t){return Ze(ie(e.name,()=>e.compute(t)))}function Dn({visitor:e,result:t,args:r,runtimeDataModel:n,modelName:i}){if(Array.isArray(t)){for(let s=0;s<t.length;s++)t[s]=Dn({result:t[s],args:r,modelName:i,runtimeDataModel:n,visitor:e});return t}let o=e(t,i,r)??t;return r.include&&ja({includeOrSelect:r.include,result:o,parentModelName:i,runtimeDataModel:n,visitor:e}),r.select&&ja({includeOrSelect:r.select,result:o,parentModelName:i,runtimeDataModel:n,visitor:e}),o}function ja({includeOrSelect:e,result:t,parentModelName:r,runtimeDataModel:n,visitor:i}){for(let[o,s]of Object.entries(e)){if(!s||t[o]==null||Te(s))continue;let l=n.models[r].fields.find(c=>c.name===o);if(!l||l.kind!=="object"||!l.relationName)continue;let u=typeof s=="object"?s:{};t[o]=Dn({visitor:i,result:t[o],args:u,modelName:l.type,runtimeDataModel:n})}}function Ba({result:e,modelName:t,args:r,extensions:n,runtimeDataModel:i,globalOmit:o}){return n.isEmpty()||e==null||typeof e!="object"||!i.models[t]?e:Dn({result:e,args:r??{},modelName:t,runtimeDataModel:i,visitor:(a,l,u)=>{let c=ve(l);return Ua({result:a,modelName:c,select:u.select,omit:u.select?void 0:{...o?.[c],...u.omit},extensions:n})}})}var Um=["$connect","$disconnect","$on","$transaction","$use","$extends"],Qa=Um;function Ha(e){if(e instanceof le)return jm(e);if(Sn(e))return Bm(e);if(Array.isArray(e)){let r=[e[0]];for(let n=1;n<e.length;n++)r[n]=hr(e[n]);return r}let t={};for(let r in e)t[r]=hr(e[r]);return t}function jm(e){return new le(e.strings,e.values)}function Bm(e){return new mr(e.sql,e.values)}function hr(e){if(typeof e!="object"||e==null||e instanceof De||vt(e))return e;if(ht(e))return new K(e.toFixed());if(yt(e))return new Date(+e);if(ArrayBuffer.isView(e))return e.slice(0);if(Array.isArray(e)){let t=e.length,r;for(r=Array(t);t--;)r[t]=hr(e[t]);return r}if(typeof e=="object"){let t={};for(let r in e)r==="__proto__"?Object.defineProperty(t,r,{value:hr(e[r]),configurable:!0,enumerable:!0,writable:!0}):t[r]=hr(e[r]);return t}fe(e,"Unknown value")}function Wa(e,t,r,n=0){return e._createPrismaPromise(i=>{let o=t.customDataProxyFetch;return"transaction"in t&&i!==void 0&&(t.transaction?.kind==="batch"&&t.transaction.lock.then(),t.transaction=i),n===r.length?e._executeRequest(t):r[n]({model:t.model,operation:t.model?t.action:t.clientMethod,args:Ha(t.args??{}),__internalParams:t,query:(s,a=t)=>{let l=a.customDataProxyFetch;return a.customDataProxyFetch=Ya(o,l),a.args=s,Wa(e,a,r,n+1)}})})}function Ja(e,t){let{jsModelName:r,action:n,clientMethod:i}=t,o=r?n:i;if(e._extensions.isEmpty())return e._executeRequest(t);let s=e._extensions.getAllQueryCallbacks(r??"$none",o);return Wa(e,t,s)}function Ka(e){return t=>{let r={requests:t},n=t[0].extensions.getAllBatchQueryCallbacks();return n.length?za(r,n,0,e):e(r)}}function za(e,t,r,n){if(r===t.length)return n(e);let i=e.customDataProxyFetch,o=e.requests[0].transaction;return t[r]({args:{queries:e.requests.map(s=>({model:s.modelName,operation:s.action,args:s.args})),transaction:o?{isolationLevel:o.kind==="batch"?o.isolationLevel:void 0}:void 0},__internalParams:e,query(s,a=e){let l=a.customDataProxyFetch;return a.customDataProxyFetch=Ya(i,l),za(a,t,r+1,n)}})}var Ga=e=>e;function Ya(e=Ga,t=Ga){return r=>e(t(r))}var Za=q("prisma:client"),Xa={Vercel:"vercel","Netlify CI":"netlify"};function el({postinstall:e,ciName:t,clientVersion:r}){if(Za("checkPlatformCaching:postinstall",e),Za("checkPlatformCaching:ciName",t),e===!0&&t&&t in Xa){let n=`Prisma has detected that this project was built on ${t}, which caches dependencies. This leads to an outdated Prisma Client because Prisma's auto-generation isn't triggered. To fix this, make sure to run the \`prisma generate\` command during the build process.
23
+ `);return t.reduce(function(r,n){var i=dm(n)||fm(n)||ym(n)||bm(n)||Em(n);return i&&r.push(i),r},[])}var cm=/^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|rsc|<anonymous>|\/|[a-z]:\\|\\\\).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,pm=/\((\S*)(?::(\d+))(?::(\d+))\)/;function dm(e){var t=cm.exec(e);if(!t)return null;var r=t[2]&&t[2].indexOf("native")===0,n=t[2]&&t[2].indexOf("eval")===0,i=pm.exec(t[2]);return n&&i!=null&&(t[2]=i[1],t[3]=i[2],t[4]=i[3]),{file:r?null:t[2],methodName:t[1]||gr,arguments:r?[t[2]]:[],lineNumber:t[3]?+t[3]:null,column:t[4]?+t[4]:null}}var mm=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|rsc|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;function fm(e){var t=mm.exec(e);return t?{file:t[2],methodName:t[1]||gr,arguments:[],lineNumber:+t[3],column:t[4]?+t[4]:null}:null}var gm=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|rsc|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,hm=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;function ym(e){var t=gm.exec(e);if(!t)return null;var r=t[3]&&t[3].indexOf(" > eval")>-1,n=hm.exec(t[3]);return r&&n!=null&&(t[3]=n[1],t[4]=n[2],t[5]=null),{file:t[3],methodName:t[1]||gr,arguments:t[2]?t[2].split(","):[],lineNumber:t[4]?+t[4]:null,column:t[5]?+t[5]:null}}var wm=/^\s*(?:([^@]*)(?:\((.*?)\))?@)?(\S.*?):(\d+)(?::(\d+))?\s*$/i;function Em(e){var t=wm.exec(e);return t?{file:t[3],methodName:t[1]||gr,arguments:[],lineNumber:+t[4],column:t[5]?+t[5]:null}:null}var xm=/^\s*at (?:((?:\[object object\])?[^\\/]+(?: \[as \S+\])?) )?\(?(.*?):(\d+)(?::(\d+))?\)?\s*$/i;function bm(e){var t=xm.exec(e);return t?{file:t[2],methodName:t[1]||gr,arguments:[],lineNumber:+t[3],column:t[4]?+t[4]:null}:null}var Vi=class{getLocation(){return null}},qi=class{_error;constructor(){this._error=new Error}getLocation(){let t=this._error.stack;if(!t)return null;let n=Ia(t).find(i=>{if(!i.file)return!1;let o=gi(i.file);return o!=="<anonymous>"&&!o.includes("@prisma")&&!o.includes("/packages/client/src/runtime/")&&!o.endsWith("/runtime/binary.js")&&!o.endsWith("/runtime/library.js")&&!o.endsWith("/runtime/edge.js")&&!o.endsWith("/runtime/edge-esm.js")&&!o.startsWith("internal/")&&!i.methodName.includes("new ")&&!i.methodName.includes("getCallSite")&&!i.methodName.includes("Proxy.")&&i.methodName.split(".").length<4});return!n||!n.file?null:{fileName:n.file,lineNumber:n.lineNumber,columnNumber:n.column}}};function Be(e){return e==="minimal"?typeof $EnabledCallSite=="function"&&e!=="minimal"?new $EnabledCallSite:new Vi:new qi}var ka={_avg:!0,_count:!0,_sum:!0,_min:!0,_max:!0};function It(e={}){let t=vm(e);return Object.entries(t).reduce((n,[i,o])=>(ka[i]!==void 0?n.select[i]={select:o}:n[i]=o,n),{select:{}})}function vm(e={}){return typeof e._count=="boolean"?{...e,_count:{_all:e._count}}:e}function On(e={}){return t=>(typeof e._count=="boolean"&&(t._count=t._count._all),t)}function Oa(e,t){let r=On(e);return t({action:"aggregate",unpacker:r,argsMapper:It})(e)}function Tm(e={}){let{select:t,...r}=e;return typeof t=="object"?It({...r,_count:t}):It({...r,_count:{_all:!0}})}function Am(e={}){return typeof e.select=="object"?t=>On(e)(t)._count:t=>On(e)(t)._count._all}function Da(e,t){return t({action:"count",unpacker:Am(e),argsMapper:Tm})(e)}function Cm(e={}){let t=It(e);if(Array.isArray(t.by))for(let r of t.by)typeof r=="string"&&(t.select[r]=!0);else typeof t.by=="string"&&(t.select[t.by]=!0);return t}function Sm(e={}){return t=>(typeof e?._count=="boolean"&&t.forEach(r=>{r._count=r._count._all}),t)}function _a(e,t){return t({action:"groupBy",unpacker:Sm(e),argsMapper:Cm})(e)}function Na(e,t,r){if(t==="aggregate")return n=>Oa(n,r);if(t==="count")return n=>Da(n,r);if(t==="groupBy")return n=>_a(n,r)}function Ma(e,t){let r=t.fields.filter(i=>!i.relationName),n=qs(r,"name");return new Proxy({},{get(i,o){if(o in i||typeof o=="symbol")return i[o];let s=n[o];if(s)return new sr(e,o,s.type,s.isList,s.kind==="enum")},...In(Object.keys(n))})}var Fa=e=>Array.isArray(e)?e:e.split("."),Ui=(e,t)=>Fa(t).reduce((r,n)=>r&&r[n],e),La=(e,t,r)=>Fa(t).reduceRight((n,i,o,s)=>Object.assign({},Ui(e,s.slice(0,o)),{[i]:n}),r);function Rm(e,t){return e===void 0||t===void 0?[]:[...t,"select",e]}function Im(e,t,r){return t===void 0?e??{}:La(t,r,e||!0)}function ji(e,t,r,n,i,o){let a=e._runtimeDataModel.models[t].fields.reduce((l,u)=>({...l,[u.name]:u}),{});return l=>{let u=Be(e._errorFormat),c=Rm(n,i),p=Im(l,o,c),d=r({dataPath:c,callsite:u})(p),f=km(e,t);return new Proxy(d,{get(g,h){if(!f.includes(h))return g[h];let T=[a[h].type,r,h],C=[c,p];return ji(e,...T,...C)},...In([...f,...Object.getOwnPropertyNames(d)])})}}function km(e,t){return e._runtimeDataModel.models[t].fields.filter(r=>r.kind==="object").map(r=>r.name)}var Om=["findUnique","findUniqueOrThrow","findFirst","findFirstOrThrow","create","update","upsert","delete"],Dm=["aggregate","count","groupBy"];function Bi(e,t){let r=e._extensions.getAllModelExtensions(t)??{},n=[_m(e,t),Mm(e,t),fr(r),ie("name",()=>t),ie("$name",()=>t),ie("$parent",()=>e._appliedParent)];return ye({},n)}function _m(e,t){let r=ve(t),n=Object.keys(wt).concat("count");return{getKeys(){return n},getPropertyValue(i){let o=i,s=a=>l=>{let u=Be(e._errorFormat);return e._createPrismaPromise(c=>{let p={args:l,dataPath:[],action:o,model:t,clientMethod:`${r}.${i}`,jsModelName:r,transaction:c,callsite:u};return e._request({...p,...a})},{action:o,args:l,model:t})};return Om.includes(o)?ji(e,t,s):Nm(i)?Na(e,i,s):s({})}}}function Nm(e){return Dm.includes(e)}function Mm(e,t){return Ze(ie("fields",()=>{let r=e._runtimeDataModel.models[t];return Ma(t,r)}))}function $a(e){return e.replace(/^./,t=>t.toUpperCase())}var Qi=Symbol();function hr(e){let t=[Fm(e),Lm(e),ie(Qi,()=>e),ie("$parent",()=>e._appliedParent)],r=e._extensions.getAllClientExtensions();return r&&t.push(fr(r)),ye(e,t)}function Fm(e){let t=Object.getPrototypeOf(e._originalClient),r=[...new Set(Object.getOwnPropertyNames(t))];return{getKeys(){return r},getPropertyValue(n){return e[n]}}}function Lm(e){let t=Object.keys(e._runtimeDataModel.models),r=t.map(ve),n=[...new Set(t.concat(r))];return Ze({getKeys(){return n},getPropertyValue(i){let o=$a(i);if(e._runtimeDataModel.models[o]!==void 0)return Bi(e,o);if(e._runtimeDataModel.models[i]!==void 0)return Bi(e,i)},getPropertyDescriptor(i){if(!r.includes(i))return{enumerable:!1}}})}function Va(e){return e[Qi]?e[Qi]:e}function qa(e){if(typeof e=="function")return e(this);if(e.client?.__AccelerateEngine){let r=e.client.__AccelerateEngine;this._originalClient._engine=new r(this._originalClient._accelerateEngineConfig)}let t=Object.create(this._originalClient,{_extensions:{value:this._extensions.append(e)},_appliedParent:{value:this,configurable:!0},$use:{value:void 0},$on:{value:void 0}});return hr(t)}function Ua({result:e,modelName:t,select:r,omit:n,extensions:i}){let o=i.getAllComputedFields(t);if(!o)return e;let s=[],a=[];for(let l of Object.values(o)){if(n){if(n[l.name])continue;let u=l.needs.filter(c=>n[c]);u.length>0&&a.push(St(u))}else if(r){if(!r[l.name])continue;let u=l.needs.filter(c=>!r[c]);u.length>0&&a.push(St(u))}$m(e,l.needs)&&s.push(Vm(l,ye(e,s)))}return s.length>0||a.length>0?ye(e,[...s,...a]):e}function $m(e,t){return t.every(r=>xi(e,r))}function Vm(e,t){return Ze(ie(e.name,()=>e.compute(t)))}function Dn({visitor:e,result:t,args:r,runtimeDataModel:n,modelName:i}){if(Array.isArray(t)){for(let s=0;s<t.length;s++)t[s]=Dn({result:t[s],args:r,modelName:i,runtimeDataModel:n,visitor:e});return t}let o=e(t,i,r)??t;return r.include&&ja({includeOrSelect:r.include,result:o,parentModelName:i,runtimeDataModel:n,visitor:e}),r.select&&ja({includeOrSelect:r.select,result:o,parentModelName:i,runtimeDataModel:n,visitor:e}),o}function ja({includeOrSelect:e,result:t,parentModelName:r,runtimeDataModel:n,visitor:i}){for(let[o,s]of Object.entries(e)){if(!s||t[o]==null||Te(s))continue;let l=n.models[r].fields.find(c=>c.name===o);if(!l||l.kind!=="object"||!l.relationName)continue;let u=typeof s=="object"?s:{};t[o]=Dn({visitor:i,result:t[o],args:u,modelName:l.type,runtimeDataModel:n})}}function Ba({result:e,modelName:t,args:r,extensions:n,runtimeDataModel:i,globalOmit:o}){return n.isEmpty()||e==null||typeof e!="object"||!i.models[t]?e:Dn({result:e,args:r??{},modelName:t,runtimeDataModel:i,visitor:(a,l,u)=>{let c=ve(l);return Ua({result:a,modelName:c,select:u.select,omit:u.select?void 0:{...o?.[c],...u.omit},extensions:n})}})}var qm=["$connect","$disconnect","$on","$transaction","$use","$extends"],Qa=qm;function Ha(e){if(e instanceof le)return Um(e);if(Sn(e))return jm(e);if(Array.isArray(e)){let r=[e[0]];for(let n=1;n<e.length;n++)r[n]=yr(e[n]);return r}let t={};for(let r in e)t[r]=yr(e[r]);return t}function Um(e){return new le(e.strings,e.values)}function jm(e){return new mr(e.sql,e.values)}function yr(e){if(typeof e!="object"||e==null||e instanceof De||vt(e))return e;if(yt(e))return new K(e.toFixed());if(ht(e))return new Date(+e);if(ArrayBuffer.isView(e))return e.slice(0);if(Array.isArray(e)){let t=e.length,r;for(r=Array(t);t--;)r[t]=yr(e[t]);return r}if(typeof e=="object"){let t={};for(let r in e)r==="__proto__"?Object.defineProperty(t,r,{value:yr(e[r]),configurable:!0,enumerable:!0,writable:!0}):t[r]=yr(e[r]);return t}fe(e,"Unknown value")}function Wa(e,t,r,n=0){return e._createPrismaPromise(i=>{let o=t.customDataProxyFetch;return"transaction"in t&&i!==void 0&&(t.transaction?.kind==="batch"&&t.transaction.lock.then(),t.transaction=i),n===r.length?e._executeRequest(t):r[n]({model:t.model,operation:t.model?t.action:t.clientMethod,args:Ha(t.args??{}),__internalParams:t,query:(s,a=t)=>{let l=a.customDataProxyFetch;return a.customDataProxyFetch=Ya(o,l),a.args=s,Wa(e,a,r,n+1)}})})}function Ja(e,t){let{jsModelName:r,action:n,clientMethod:i}=t,o=r?n:i;if(e._extensions.isEmpty())return e._executeRequest(t);let s=e._extensions.getAllQueryCallbacks(r??"$none",o);return Wa(e,t,s)}function Ka(e){return t=>{let r={requests:t},n=t[0].extensions.getAllBatchQueryCallbacks();return n.length?za(r,n,0,e):e(r)}}function za(e,t,r,n){if(r===t.length)return n(e);let i=e.customDataProxyFetch,o=e.requests[0].transaction;return t[r]({args:{queries:e.requests.map(s=>({model:s.modelName,operation:s.action,args:s.args})),transaction:o?{isolationLevel:o.kind==="batch"?o.isolationLevel:void 0}:void 0},__internalParams:e,query(s,a=e){let l=a.customDataProxyFetch;return a.customDataProxyFetch=Ya(i,l),za(a,t,r+1,n)}})}var Ga=e=>e;function Ya(e=Ga,t=Ga){return r=>e(t(r))}var Za=q("prisma:client"),Xa={Vercel:"vercel","Netlify CI":"netlify"};function el({postinstall:e,ciName:t,clientVersion:r}){if(Za("checkPlatformCaching:postinstall",e),Za("checkPlatformCaching:ciName",t),e===!0&&t&&t in Xa){let n=`Prisma has detected that this project was built on ${t}, which caches dependencies. This leads to an outdated Prisma Client because Prisma's auto-generation isn't triggered. To fix this, make sure to run the \`prisma generate\` command during the build process.
24
24
 
25
- Learn how: https://pris.ly/d/${Xa[t]}-build`;throw console.error(n),new k(n,r)}}function tl(e,t){return e?e.datasources?e.datasources:e.datasourceUrl?{[t[0]]:{url:e.datasourceUrl}}:{}:{}}var Qm=()=>globalThis.process?.release?.name==="node",Hm=()=>!!globalThis.Bun||!!globalThis.process?.versions?.bun,Gm=()=>!!globalThis.Deno,Wm=()=>typeof globalThis.Netlify=="object",Jm=()=>typeof globalThis.EdgeRuntime=="object",Km=()=>globalThis.navigator?.userAgent==="Cloudflare-Workers";function zm(){return[[Wm,"netlify"],[Jm,"edge-light"],[Km,"workerd"],[Gm,"deno"],[Hm,"bun"],[Qm,"node"]].flatMap(r=>r[0]()?[r[1]]:[]).at(0)??""}var Ym={node:"Node.js",workerd:"Cloudflare Workers",deno:"Deno and Deno Deploy",netlify:"Netlify Edge Functions","edge-light":"Edge Runtime (Vercel Edge Functions, Vercel Edge Middleware, Next.js (Pages Router) Edge API Routes, Next.js (App Router) Edge Route Handlers or Next.js Middleware)"};function _n(){let e=zm();return{id:e,prettyName:Ym[e]||e,isEdge:["workerd","deno","netlify","edge-light"].includes(e)}}var Hi=j(fi());function rl(e){return e?e.replace(/".*"/g,'"X"').replace(/[\s:\[]([+-]?([0-9]*[.])?[0-9]+)/g,t=>`${t[0]}5`):""}function nl(e){return e.split(`
25
+ Learn how: https://pris.ly/d/${Xa[t]}-build`;throw console.error(n),new k(n,r)}}function tl(e,t){return e?e.datasources?e.datasources:e.datasourceUrl?{[t[0]]:{url:e.datasourceUrl}}:{}:{}}var Bm=()=>globalThis.process?.release?.name==="node",Qm=()=>!!globalThis.Bun||!!globalThis.process?.versions?.bun,Hm=()=>!!globalThis.Deno,Gm=()=>typeof globalThis.Netlify=="object",Wm=()=>typeof globalThis.EdgeRuntime=="object",Jm=()=>globalThis.navigator?.userAgent==="Cloudflare-Workers";function Km(){return[[Gm,"netlify"],[Wm,"edge-light"],[Jm,"workerd"],[Hm,"deno"],[Qm,"bun"],[Bm,"node"]].flatMap(r=>r[0]()?[r[1]]:[]).at(0)??""}var zm={node:"Node.js",workerd:"Cloudflare Workers",deno:"Deno and Deno Deploy",netlify:"Netlify Edge Functions","edge-light":"Edge Runtime (Vercel Edge Functions, Vercel Edge Middleware, Next.js (Pages Router) Edge API Routes, Next.js (App Router) Edge Route Handlers or Next.js Middleware)"};function _n(){let e=Km();return{id:e,prettyName:zm[e]||e,isEdge:["workerd","deno","netlify","edge-light"].includes(e)}}var Hi=j(fi());function rl(e){return e?e.replace(/".*"/g,'"X"').replace(/[\s:\[]([+-]?([0-9]*[.])?[0-9]+)/g,t=>`${t[0]}5`):""}function nl(e){return e.split(`
26
26
  `).map(t=>t.replace(/^\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z)\s*/,"").replace(/\+\d+\s*ms$/,"")).join(`
27
27
  `)}var il=j(vs());function ol({title:e,user:t="prisma",repo:r="prisma",template:n="bug_report.yml",body:i}){return(0,il.default)({user:t,repo:r,template:n,title:e,body:i})}function sl({version:e,binaryTarget:t,title:r,description:n,engineVersion:i,database:o,query:s}){let a=es(6e3-(s?.length??0)),l=nl((0,Hi.default)(a)),u=n?`# Description
28
28
  \`\`\`
@@ -68,27 +68,27 @@ ${se(p)}
68
68
  If you want the Prisma team to look into it, please open the link above \u{1F64F}
69
69
  To increase the chance of success, please post your schema and a snippet of
70
70
  how you used Prisma Client in the issue.
71
- `}function L(e,t){throw new Error(t)}function Gi(e,t){return e===t||e!==null&&t!==null&&typeof e=="object"&&typeof t=="object"&&Object.keys(e).length===Object.keys(t).length&&Object.keys(e).every(r=>Gi(e[r],t[r]))}function wr(e,t){let r=Object.keys(e),n=Object.keys(t);return(r.length<n.length?r:n).every(o=>{if(typeof e[o]!=typeof t[o]){if(typeof e[o]=="number"||typeof t[o]=="number")return`${e[o]}`==`${t[o]}`;if(typeof e[o]=="bigint"||typeof t[o]=="bigint")return BigInt(`${e[o]}`.replace(/n$/,""))===BigInt(`${t[o]}`.replace(/n$/,""));if(e[o]instanceof Date||t[o]instanceof Date)return new Date(`${e[o]}`).getTime()===new Date(`${t[o]}`).getTime();if(K.isDecimal(e[o])||K.isDecimal(t[o]))return new K(`${e[o]}`).equals(new K(`${t[o]}`))}return Gi(e[o],t[o])})}function Er(e){return JSON.stringify(e,(t,r)=>typeof r=="bigint"?r.toString():r instanceof Uint8Array?Buffer.from(r).toString("base64"):r)}var V=class extends Error{name="DataMapperError"};function ul(e,t,r){switch(t.type){case"AffectedRows":if(typeof e!="number")throw new V(`Expected an affected rows count, got: ${typeof e} (${e})`);return{count:e};case"Object":return Wi(e,t.fields,r);case"Value":return Ji(e,"<result>",t.resultType,r);default:L(t,`Invalid data mapping type: '${t.type}'`)}}function Wi(e,t,r){if(e===null)return null;if(Array.isArray(e))return e.map(i=>al(i,t,r));if(typeof e=="object")return al(e,t,r);if(typeof e=="string"){let n;try{n=JSON.parse(e)}catch(i){throw new V("Expected an array or object, got a string that is not valid JSON",{cause:i})}return Wi(n,t,r)}throw new V(`Expected an array or an object, got: ${typeof e}`)}function al(e,t,r){if(typeof e!="object")throw new V(`Expected an object, but got '${typeof e}'`);let n={};for(let[i,o]of Object.entries(t))switch(o.type){case"AffectedRows":throw new V(`Unexpected 'AffectedRows' node in data mapping for field '${i}'`);case"Object":{if(o.serializedName!==null&&!Object.hasOwn(e,o.serializedName))throw new V(`Missing data field (Object): '${i}'; node: ${JSON.stringify(o)}; data: ${JSON.stringify(e)}`);let s=o.serializedName!==null?e[o.serializedName]:e;n[i]=Wi(s,o.fields,r);break}case"Value":{let s=o.dbName;if(Object.hasOwn(e,s))n[i]=Ji(e[s],s,o.resultType,r);else throw new V(`Missing data field (Value): '${s}'; node: ${JSON.stringify(o)}; data: ${JSON.stringify(e)}`)}break;default:L(o,`DataMapper: Invalid data mapping node type: '${o.type}'`)}return n}function Ji(e,t,r,n){if(e===null)return r.type==="Array"?[]:null;switch(r.type){case"Any":return e;case"String":{if(typeof e!="string")throw new V(`Expected a string in column '${t}', got ${typeof e}: ${e}`);return e}case"Int":switch(typeof e){case"number":return Math.trunc(e);case"string":{let i=Math.trunc(Number(e));if(Number.isNaN(i)||!Number.isFinite(i))throw new V(`Expected an integer in column '${t}', got string: ${e}`);if(!Number.isSafeInteger(i))throw new V(`Integer value in column '${t}' is too large to represent as a JavaScript number without loss of precision, got: ${e}. Consider using BigInt type.`);return i}default:throw new V(`Expected an integer in column '${t}', got ${typeof e}: ${e}`)}case"BigInt":{if(typeof e!="number"&&typeof e!="string")throw new V(`Expected a bigint in column '${t}', got ${typeof e}: ${e}`);return{$type:"BigInt",value:e}}case"Float":{if(typeof e=="number")return e;if(typeof e=="string"){let i=Number(e);if(Number.isNaN(i)&&!/^[-+]?nan$/.test(e.toLowerCase()))throw new V(`Expected a float in column '${t}', got string: ${e}`);return i}throw new V(`Expected a float in column '${t}', got ${typeof e}: ${e}`)}case"Boolean":{if(typeof e=="boolean")return e;if(typeof e=="number")return e===1;if(typeof e=="string"){if(e==="true"||e==="TRUE"||e==="1")return!0;if(e==="false"||e==="FALSE"||e==="0")return!1;throw new V(`Expected a boolean in column '${t}', got ${typeof e}: ${e}`)}if(e instanceof Uint8Array){for(let i of e)if(i!==0)return!0;return!1}throw new V(`Expected a boolean in column '${t}', got ${typeof e}: ${e}`)}case"Decimal":if(typeof e!="number"&&typeof e!="string"&&!K.isDecimal(e))throw new V(`Expected a decimal in column '${t}', got ${typeof e}: ${e}`);return{$type:"Decimal",value:e};case"Date":{if(typeof e=="string")return{$type:"DateTime",value:ll(e)};if(typeof e=="number"||e instanceof Date)return{$type:"DateTime",value:e};throw new V(`Expected a date in column '${t}', got ${typeof e}: ${e}`)}case"Time":{if(typeof e=="string")return{$type:"DateTime",value:`1970-01-01T${ll(e)}`};throw new V(`Expected a time in column '${t}', got ${typeof e}: ${e}`)}case"Array":return e.map((o,s)=>Ji(o,`${t}[${s}]`,r.inner,n));case"Object":return{$type:"Json",value:typeof e=="string"?e:Er(e)};case"Bytes":{if(typeof e=="string"&&e.startsWith("\\x"))return{$type:"Bytes",value:Buffer.from(e.slice(2),"hex").toString("base64")};if(Array.isArray(e))return{$type:"Bytes",value:Buffer.from(e).toString("base64")};if(e instanceof Uint8Array)return{$type:"Bytes",value:Buffer.from(e).toString("base64")};throw new V(`Expected a byte array in column '${t}', got ${typeof e}: ${e}`)}case"Enum":{let i=n[r.inner];if(i===void 0)throw new V(`Unknown enum '${r.inner}'`);let o=i[`${e}`];if(o===void 0)throw new V(`Unknown enum value '${e}' for enum '${r.inner}'`);return o}default:L(r,`DataMapper: Unknown result type: ${r.type}`)}}var Zm=/Z$|(?<!\d{4}-\d{2})[+-]\d{2}(:?\d{2})?$/;function ll(e){let t=Zm.exec(e);return t===null?`${e}Z`:t[0]!=="Z"&&t[1]===void 0?`${e}:00`:e}var xr;(function(e){e[e.INTERNAL=0]="INTERNAL",e[e.SERVER=1]="SERVER",e[e.CLIENT=2]="CLIENT",e[e.PRODUCER=3]="PRODUCER",e[e.CONSUMER=4]="CONSUMER"})(xr||(xr={}));function Xm(e){switch(e){case"postgres":return"postgresql";case"mysql":return"mysql";case"sqlite":return"sqlite";case"sqlserver":return"mssql";default:L(e,`Unknown provider: ${e}`)}}async function Nn({query:e,queryable:t,tracingHelper:r,onQuery:n,execute:i}){return await r.runInChildSpan({name:"db_query",kind:xr.CLIENT,attributes:{"db.query.text":e.sql,"db.system.name":Xm(t.provider)}},async()=>{let o=new Date,s=performance.now(),a=await i(),l=performance.now();return n?.({timestamp:o,duration:l-s,query:e.sql,params:e.args}),a})}function Ki(e){return e.name==="DriverAdapterError"&&typeof e.cause=="object"}var T={Int32:0,Int64:1,Float:2,Double:3,Numeric:4,Boolean:5,Character:6,Text:7,Date:8,Time:9,DateTime:10,Json:11,Enum:12,Bytes:13,Set:14,Uuid:15,Int32Array:64,Int64Array:65,FloatArray:66,DoubleArray:67,NumericArray:68,BooleanArray:69,CharacterArray:70,TextArray:71,DateArray:72,TimeArray:73,DateTimeArray:74,JsonArray:75,EnumArray:76,BytesArray:77,UuidArray:78,UnknownNumber:128};var Ae=class extends Error{name="UserFacingError";code;meta;constructor(t,r,n){super(t),this.code=r,this.meta=n??{}}toQueryResponseErrorObject(){return{error:this.message,user_facing_error:{is_panic:!1,message:this.message,meta:this.meta,error_code:this.code}}}};function cl(e){if(!Ki(e))throw e;let t=ef(e),r=tf(e);throw!t||!r?e:new Ae(r,t,{driverAdapterError:e})}function ef(e){switch(e.cause.kind){case"AuthenticationFailed":return"P1000";case"DatabaseDoesNotExist":return"P1003";case"SocketTimeout":return"P1008";case"DatabaseAlreadyExists":return"P1009";case"DatabaseAccessDenied":return"P1010";case"TransactionAlreadyClosed":return"P1018";case"LengthMismatch":return"P2000";case"UniqueConstraintViolation":return"P2002";case"ForeignKeyConstraintViolation":return"P2003";case"UnsupportedNativeDataType":return"P2010";case"NullConstraintViolation":return"P2011";case"ValueOutOfRange":return"P2020";case"TableDoesNotExist":return"P2021";case"ColumnNotFound":return"P2022";case"InvalidIsolationLevel":case"InconsistentColumnData":return"P2023";case"MissingFullTextSearchIndex":return"P2030";case"TransactionWriteConflict":return"P2034";case"GenericJs":return"P2036";case"TooManyConnections":return"P2037";case"postgres":case"sqlite":case"mysql":case"mssql":return;default:L(e.cause,`Unknown error: ${e.cause}`)}}function tf(e){switch(e.cause.kind){case"AuthenticationFailed":return`Authentication failed against the database server, the provided database credentials for \`${e.cause.user??"(not available)"}\` are not valid`;case"DatabaseDoesNotExist":return`Database \`${e.cause.db??"(not available)"}\` does not exist on the database server`;case"SocketTimeout":return"Operation has timed out";case"DatabaseAlreadyExists":return`Database \`${e.cause.db??"(not available)"}\` already exists on the database server`;case"DatabaseAccessDenied":return`User was denied access on the database \`${e.cause.db??"(not available)"}\``;case"TransactionAlreadyClosed":return e.cause.cause;case"LengthMismatch":return`The provided value for the column is too long for the column's type. Column: ${e.cause.column??"(not available)"}`;case"UniqueConstraintViolation":return`Unique constraint failed on the ${zi(e.cause.constraint)}`;case"ForeignKeyConstraintViolation":return`Foreign key constraint violated on the ${zi(e.cause.constraint)}`;case"UnsupportedNativeDataType":return`Failed to deserialize column of type '${e.cause.type}'. If you're using $queryRaw and this column is explicitly marked as \`Unsupported\` in your Prisma schema, try casting this column to any supported Prisma type such as \`String\`.`;case"NullConstraintViolation":return`Null constraint violation on the ${zi(e.cause.constraint)}`;case"ValueOutOfRange":return`Value out of range for the type. ${e.cause.cause}`;case"TableDoesNotExist":return`The table \`${e.cause.table??"(not available)"}\` does not exist in the current database.`;case"ColumnNotFound":return`The column \`${e.cause.column??"(not available)"}\` does not exist in the current database.`;case"InvalidIsolationLevel":return`Invalid isolation level \`${e.cause.level}\``;case"InconsistentColumnData":return`Inconsistent column data: ${e.cause.cause}`;case"MissingFullTextSearchIndex":return"Cannot find a fulltext index to use for the native search, try adding a @@fulltext([Fields...]) to your schema";case"TransactionWriteConflict":return"Transaction failed due to a write conflict or a deadlock. Please retry your transaction";case"GenericJs":return`Error in external connector (id ${e.cause.id})`;case"TooManyConnections":return`Too many database connections opened: ${e.cause.cause}`;case"sqlite":case"postgres":case"mysql":case"mssql":return;default:L(e.cause,`Unknown error: ${e.cause}`)}}function zi(e){return e&&"fields"in e?`fields: (${e.fields.map(t=>`\`${t}\``).join(", ")})`:e&&"index"in e?`constraint: \`${e.index}\``:e&&"foreignKey"in e?"foreign key":"(not available)"}function Xe(e,t){var r="000000000"+e;return r.substr(r.length-t)}var pl=j(require("node:os"),1);function rf(){try{return pl.default.hostname()}catch{return process.env._CLUSTER_NETWORK_NAME_||process.env.COMPUTERNAME||"hostname"}}var dl=2,nf=Xe(process.pid.toString(36),dl),ml=rf(),of=ml.length,sf=Xe(ml.split("").reduce(function(e,t){return+e+t.charCodeAt(0)},+of+36).toString(36),dl);function Yi(){return nf+sf}function Mn(e){return typeof e=="string"&&/^c[a-z0-9]{20,32}$/.test(e)}function Zi(e){let n=Math.pow(36,4),i=0;function o(){return Xe((Math.random()*n<<0).toString(36),4)}function s(){return i=i<n?i:0,i++,i-1}function a(){var l="c",u=new Date().getTime().toString(36),c=Xe(s().toString(36),4),p=e(),d=o()+o();return l+u+c+p+d}return a.fingerprint=e,a.isCuid=Mn,a}var af=Zi(Yi);var fl=af;var mu=j(iu());var ao=require("node:crypto");var ou="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var Wf=128,tt,Dt;function Jf(e){!tt||tt.length<e?(tt=Buffer.allocUnsafe(e*Wf),ao.webcrypto.getRandomValues(tt),Dt=0):Dt+e>tt.length&&(ao.webcrypto.getRandomValues(tt),Dt=0),Dt+=e}function lo(e=21){Jf(e|=0);let t="";for(let r=Dt-e;r<Dt;r++)t+=ou[tt[r]&63];return t}var Cr=j(require("node:crypto"),1);var au="0123456789ABCDEFGHJKMNPQRSTVWXYZ",Sr=32;var Kf=16,lu=10,su=0xffffffffffff;var rt;(function(e){e.Base32IncorrectEncoding="B32_ENC_INVALID",e.DecodeTimeInvalidCharacter="DEC_TIME_CHAR",e.DecodeTimeValueMalformed="DEC_TIME_MALFORMED",e.EncodeTimeNegative="ENC_TIME_NEG",e.EncodeTimeSizeExceeded="ENC_TIME_SIZE_EXCEED",e.EncodeTimeValueMalformed="ENC_TIME_MALFORMED",e.PRNGDetectFailure="PRNG_DETECT",e.ULIDInvalid="ULID_INVALID",e.Unexpected="UNEXPECTED",e.UUIDInvalid="UUID_INVALID"})(rt||(rt={}));var nt=class extends Error{constructor(t,r){super(`${r} (${t})`),this.name="ULIDError",this.code=t}};function zf(e){let t=Math.floor(e()*Sr);return t===Sr&&(t=Sr-1),au.charAt(t)}function Yf(e){let t=Zf(),r=t&&(t.crypto||t.msCrypto)||(typeof Cr.default<"u"?Cr.default:null);if(typeof r?.getRandomValues=="function")return()=>{let n=new Uint8Array(1);return r.getRandomValues(n),n[0]/255};if(typeof r?.randomBytes=="function")return()=>r.randomBytes(1).readUInt8()/255;if(Cr.default?.randomBytes)return()=>Cr.default.randomBytes(1).readUInt8()/255;throw new nt(rt.PRNGDetectFailure,"Failed to find a reliable PRNG")}function Zf(){return tg()?self:typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:null}function Xf(e,t){let r="";for(;e>0;e--)r=zf(t)+r;return r}function eg(e,t=lu){if(isNaN(e))throw new nt(rt.EncodeTimeValueMalformed,`Time must be a number: ${e}`);if(e>su)throw new nt(rt.EncodeTimeSizeExceeded,`Cannot encode a time larger than ${su}: ${e}`);if(e<0)throw new nt(rt.EncodeTimeNegative,`Time must be positive: ${e}`);if(Number.isInteger(e)===!1)throw new nt(rt.EncodeTimeValueMalformed,`Time must be an integer: ${e}`);let r,n="";for(let i=t;i>0;i--)r=e%Sr,n=au.charAt(r)+n,e=(e-r)/Sr;return n}function tg(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}function uu(e,t){let r=t||Yf(),n=!e||isNaN(e)?Date.now():e;return eg(n,lu)+Xf(Kf,r)}var z=[];for(let e=0;e<256;++e)z.push((e+256).toString(16).slice(1));function Vn(e,t=0){return(z[e[t+0]]+z[e[t+1]]+z[e[t+2]]+z[e[t+3]]+"-"+z[e[t+4]]+z[e[t+5]]+"-"+z[e[t+6]]+z[e[t+7]]+"-"+z[e[t+8]]+z[e[t+9]]+"-"+z[e[t+10]]+z[e[t+11]]+z[e[t+12]]+z[e[t+13]]+z[e[t+14]]+z[e[t+15]]).toLowerCase()}var cu=require("node:crypto"),Un=new Uint8Array(256),qn=Un.length;function _t(){return qn>Un.length-16&&((0,cu.randomFillSync)(Un),qn=0),Un.slice(qn,qn+=16)}var pu=require("node:crypto"),uo={randomUUID:pu.randomUUID};function rg(e,t,r){if(uo.randomUUID&&!t&&!e)return uo.randomUUID();e=e||{};let n=e.random??e.rng?.()??_t();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){if(r=r||0,r<0||r+16>t.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let i=0;i<16;++i)t[r+i]=n[i];return t}return Vn(n)}var co=rg;var po={};function ng(e,t,r){let n;if(e)n=du(e.random??e.rng?.()??_t(),e.msecs,e.seq,t,r);else{let i=Date.now(),o=_t();ig(po,i,o),n=du(o,po.msecs,po.seq,t,r)}return t??Vn(n)}function ig(e,t,r){return e.msecs??=-1/0,e.seq??=0,t>e.msecs?(e.seq=r[6]<<23|r[7]<<16|r[8]<<8|r[9],e.msecs=t):(e.seq=e.seq+1|0,e.seq===0&&e.msecs++),e}function du(e,t,r,n,i=0){if(e.length<16)throw new Error("Random bytes length must be >= 16");if(!n)n=new Uint8Array(16),i=0;else if(i<0||i+16>n.length)throw new RangeError(`UUID byte range ${i}:${i+15} is out of buffer bounds`);return t??=Date.now(),r??=e[6]*127<<24|e[7]<<16|e[8]<<8|e[9],n[i++]=t/1099511627776&255,n[i++]=t/4294967296&255,n[i++]=t/16777216&255,n[i++]=t/65536&255,n[i++]=t/256&255,n[i++]=t&255,n[i++]=112|r>>>28&15,n[i++]=r>>>20&255,n[i++]=128|r>>>14&63,n[i++]=r>>>6&255,n[i++]=r<<2&255|e[10]&3,n[i++]=e[11],n[i++]=e[12],n[i++]=e[13],n[i++]=e[14],n[i++]=e[15],n}var mo=ng;var jn=class{#e={};constructor(){this.register("uuid",new yo),this.register("cuid",new ho),this.register("ulid",new wo),this.register("nanoid",new Eo),this.register("product",new xo)}snapshot(t){return Object.create(this.#e,{now:{value:t==="mysql"?new go:new fo}})}register(t,r){this.#e[t]=r}},fo=class{#e=new Date;generate(){return this.#e.toISOString()}},go=class{#e=new Date;generate(){return this.#e.toISOString().replace("T"," ").replace("Z","")}},yo=class{generate(t){if(t===4)return co();if(t===7)return mo();throw new Error("Invalid UUID generator arguments")}},ho=class{generate(t){if(t===1)return fl();if(t===2)return(0,mu.createId)();throw new Error("Invalid CUID generator arguments")}},wo=class{generate(){return uu()}},Eo=class{generate(t){if(typeof t=="number")return lo(t);if(t===void 0)return lo();throw new Error("Invalid Nanoid generator arguments")}},xo=class{generate(t,r){if(t===void 0||r===void 0)throw new Error("Invalid Product generator arguments");return Array.isArray(t)&&Array.isArray(r)?t.flatMap(n=>r.map(i=>[n,i])):Array.isArray(t)?t.map(n=>[n,r]):Array.isArray(r)?r.map(n=>[t,n]):[[t,r]]}};function bo(e){return typeof e=="object"&&e!==null&&e.prisma__type==="param"}function Po(e){return typeof e=="object"&&e!==null&&e.prisma__type==="generatorCall"}function fu(e){return typeof e=="object"&&e!==null&&e.prisma__type==="bytes"}function gu(e){return typeof e=="object"&&e!==null&&e.prisma__type==="bigint"}function To(e,t,r){let n=e.type;switch(n){case"rawSql":return hu(e.sql,yu(e.params,t,r));case"templateSql":return og(e.fragments,e.placeholderFormat,yu(e.params,t,r));default:L(n,"Invalid query type")}}function yu(e,t,r){return e.map(n=>we(n,t,r))}function we(e,t,r){let n=e;for(;ag(n);)if(bo(n)){let i=t[n.prisma__value.name];if(i===void 0)throw new Error(`Missing value for query variable ${n.prisma__value.name}`);n=i}else if(Po(n)){let{name:i,args:o}=n.prisma__value,s=r[i];if(!s)throw new Error(`Encountered an unknown generator '${i}'`);n=s.generate(...o.map(a=>we(a,t,r)))}else L(n,`Unexpected unevaluated value type: ${n}`);return Array.isArray(n)?n=n.map(i=>we(i,t,r)):fu(n)?n=Buffer.from(n.prisma__value,"base64"):gu(n)&&(n=BigInt(n.prisma__value)),n}function og(e,t,r){let n=0,i=1,o=[],s=e.map(a=>{let l=a.type;switch(l){case"parameter":if(n>=r.length)throw new Error(`Malformed query template. Fragments attempt to read over ${r.length} parameters.`);return o.push(r[n++]),vo(t,i++);case"stringChunk":return a.chunk;case"parameterTuple":{if(n>=r.length)throw new Error(`Malformed query template. Fragments attempt to read over ${r.length} parameters.`);let u=r[n++],c=Array.isArray(u)?u:[u];return`(${c.length==0?"NULL":c.map(d=>(o.push(d),vo(t,i++))).join(",")})`}case"parameterTupleList":{if(n>=r.length)throw new Error(`Malformed query template. Fragments attempt to read over ${r.length} parameters.`);let u=r[n++];if(!Array.isArray(u))throw new Error("Malformed query template. Tuple list expected.");if(u.length===0)throw new Error("Malformed query template. Tuple list cannot be empty.");return u.map(p=>{if(!Array.isArray(p))throw new Error("Malformed query template. Tuple expected.");let d=p.map(m=>(o.push(m),vo(t,i++))).join(a.itemSeparator);return`${a.itemPrefix}${d}${a.itemSuffix}`}).join(a.groupSeparator)}default:L(l,"Invalid fragment type")}}).join("");return hu(s,o)}function vo(e,t){return e.hasNumbering?`${e.prefix}${t}`:e.prefix}function hu(e,t){let r=t.map(n=>sg(n));return{sql:e,args:t,argTypes:r}}function sg(e){return typeof e=="string"?"Text":typeof e=="number"?"Numeric":typeof e=="boolean"?"Boolean":Array.isArray(e)?"Array":Buffer.isBuffer(e)?"Bytes":"Unknown"}function ag(e){return bo(e)||Po(e)}function Eu(e){let t=e.columnTypes.map(r=>{switch(r){case T.Bytes:return n=>Array.isArray(n)?new Uint8Array(n):n;default:return n=>n}});return e.rows.map(r=>r.map((n,i)=>t[i](n)).reduce((n,i,o)=>{let s=e.columnNames[o].split("."),a=n;for(let l=0;l<s.length;l++){let u=s[l];l===s.length-1?a[u]=i:(a[u]===void 0&&(a[u]={}),a=a[u])}return n},{}))}function xu(e){let r=e.columnTypes.map(n=>wu(n)).map(n=>{switch(n){case"bytes":return i=>Array.isArray(i)?new Uint8Array(i):i;case"int":return i=>i===null?null:typeof i=="number"?i:parseInt(`${i}`,10);case"bigint":return i=>i===null?null:typeof i=="bigint"?i:BigInt(`${i}`);case"json":return i=>typeof i=="string"?JSON.parse(i):i;case"bool":return i=>typeof i=="string"?i==="true"||i==="1":typeof i=="number"?i===1:i;default:return i=>i}});return{columns:e.columnNames,types:e.columnTypes.map(n=>wu(n)),rows:e.rows.map(n=>n.map((i,o)=>r[o](i)))}}function wu(e){switch(e){case T.Int32:return"int";case T.Int64:return"bigint";case T.Float:return"float";case T.Double:return"double";case T.Text:return"string";case T.Enum:return"enum";case T.Bytes:return"bytes";case T.Boolean:return"bool";case T.Character:return"char";case T.Numeric:return"decimal";case T.Json:return"json";case T.Uuid:return"uuid";case T.DateTime:return"datetime";case T.Date:return"date";case T.Time:return"time";case T.Int32Array:return"int-array";case T.Int64Array:return"bigint-array";case T.FloatArray:return"float-array";case T.DoubleArray:return"double-array";case T.TextArray:return"string-array";case T.EnumArray:return"string-array";case T.BytesArray:return"bytes-array";case T.BooleanArray:return"bool-array";case T.CharacterArray:return"char-array";case T.NumericArray:return"decimal-array";case T.JsonArray:return"json-array";case T.UuidArray:return"uuid-array";case T.DateTimeArray:return"datetime-array";case T.DateArray:return"date-array";case T.TimeArray:return"time-array";case T.UnknownNumber:return"unknown";case T.Set:return"string";default:L(e,`Unexpected column type: ${e}`)}}function bu(e,t,r){if(!t.every(n=>Ao(e,n))){let n=lg(e,r),i=ug(r);throw new Ae(n,i,r.context)}}function Ao(e,t){switch(t.type){case"rowCountEq":return Array.isArray(e)?e.length===t.args:e===null?t.args===0:t.args===1;case"rowCountNeq":return Array.isArray(e)?e.length!==t.args:e===null?t.args!==0:t.args!==1;case"affectedRowCountEq":return e===t.args;case"never":return!1;default:L(t,`Unknown rule type: ${t.type}`)}}function lg(e,t){switch(t.error_identifier){case"RELATION_VIOLATION":return`The change you are trying to make would violate the required relation '${t.context.relation}' between the \`${t.context.modelA}\` and \`${t.context.modelB}\` models.`;case"MISSING_RECORD":return`An operation failed because it depends on one or more records that were required but not found. No record was found for ${t.context.operation}.`;case"MISSING_RELATED_RECORD":{let r=t.context.neededFor?` (needed to ${t.context.neededFor})`:"";return`An operation failed because it depends on one or more records that were required but not found. No '${t.context.model}' record${r} was found for ${t.context.operation} on ${t.context.relationType} relation '${t.context.relation}'.`}case"INCOMPLETE_CONNECT_INPUT":return`An operation failed because it depends on one or more records that were required but not found. Expected ${t.context.expectedRows} records to be connected, found only ${Array.isArray(e)?e.length:e}.`;case"INCOMPLETE_CONNECT_OUTPUT":return`The required connected records were not found. Expected ${t.context.expectedRows} records to be connected after connect operation on ${t.context.relationType} relation '${t.context.relation}', found ${Array.isArray(e)?e.length:e}.`;case"RECORDS_NOT_CONNECTED":return`The records for relation \`${t.context.relation}\` between the \`${t.context.parent}\` and \`${t.context.child}\` models are not connected.`;default:L(t,`Unknown error identifier: ${t}`)}}function ug(e){switch(e.error_identifier){case"RELATION_VIOLATION":return"P2014";case"RECORDS_NOT_CONNECTED":return"P2017";case"INCOMPLETE_CONNECT_OUTPUT":return"P2018";case"MISSING_RECORD":case"MISSING_RELATED_RECORD":case"INCOMPLETE_CONNECT_INPUT":return"P2025";default:L(e,`Unknown error identifier: ${e}`)}}var Nt=class e{#e;#r;#t;#o=new jn;#n;#s;#i;constructor({transactionManager:t,placeholderValues:r,onQuery:n,tracingHelper:i,serializer:o,rawSerializer:s}){this.#e=t,this.#r=r,this.#t=n,this.#n=i,this.#s=o,this.#i=s??o}static forSql(t){return new e({transactionManager:t.transactionManager,placeholderValues:t.placeholderValues,onQuery:t.onQuery,tracingHelper:t.tracingHelper,serializer:Eu,rawSerializer:xu})}async run(t,r){let{value:n}=await this.interpretNode(t,r,this.#r,this.#o.snapshot(r.provider)).catch(i=>cl(i));return n}async interpretNode(t,r,n,i){switch(t.type){case"value":return{value:we(t.args,n,i)};case"seq":{let o;for(let s of t.args)o=await this.interpretNode(s,r,n,i);return o??{value:void 0}}case"get":return{value:n[t.args.name]};case"let":{let o=Object.create(n);for(let s of t.args.bindings){let{value:a}=await this.interpretNode(s.expr,r,o,i);o[s.name]=a}return this.interpretNode(t.args.expr,r,o,i)}case"getFirstNonEmpty":{for(let o of t.args.names){let s=n[o];if(!Pu(s))return{value:s}}return{value:[]}}case"concat":{let o=await Promise.all(t.args.map(s=>this.interpretNode(s,r,n,i).then(a=>a.value)));return{value:o.length>0?o.reduce((s,a)=>s.concat(Rr(a)),[]):[]}}case"sum":{let o=await Promise.all(t.args.map(s=>this.interpretNode(s,r,n,i).then(a=>a.value)));return{value:o.length>0?o.reduce((s,a)=>Ce(s)+Ce(a)):0}}case"execute":{let o=To(t.args,n,i);return this.#a(o,r,async()=>({value:await r.executeRaw(o)}))}case"query":{let o=To(t.args,n,i);return this.#a(o,r,async()=>{let s=await r.queryRaw(o);return t.args.type==="rawSql"?{value:this.#i(s),lastInsertId:s.lastInsertId}:{value:this.#s(s),lastInsertId:s.lastInsertId}})}case"reverse":{let{value:o,lastInsertId:s}=await this.interpretNode(t.args,r,n,i);return{value:Array.isArray(o)?o.reverse():o,lastInsertId:s}}case"unique":{let{value:o,lastInsertId:s}=await this.interpretNode(t.args,r,n,i);if(!Array.isArray(o))return{value:o,lastInsertId:s};if(o.length>1)throw new Error(`Expected zero or one element, got ${o.length}`);return{value:o[0]??null,lastInsertId:s}}case"required":{let{value:o,lastInsertId:s}=await this.interpretNode(t.args,r,n,i);if(Pu(o))throw new Error("Required value is empty");return{value:o,lastInsertId:s}}case"mapField":{let{value:o,lastInsertId:s}=await this.interpretNode(t.args.records,r,n,i);return{value:Tu(o,t.args.field),lastInsertId:s}}case"join":{let{value:o,lastInsertId:s}=await this.interpretNode(t.args.parent,r,n,i);if(o===null)return{value:null,lastInsertId:s};let a=await Promise.all(t.args.children.map(async l=>({joinExpr:l,childRecords:(await this.interpretNode(l.child,r,n,i)).value})));return{value:cg(o,a),lastInsertId:s}}case"transaction":{if(!this.#e.enabled)return this.interpretNode(t.args,r,n,i);let o=this.#e.manager,s=await o.startTransaction(),a=o.getTransaction(s,"query");try{let l=await this.interpretNode(t.args,a,n,i);return await o.commitTransaction(s.id),l}catch(l){throw await o.rollbackTransaction(s.id),l}}case"dataMap":{let{value:o,lastInsertId:s}=await this.interpretNode(t.args.expr,r,n,i);return{value:ul(o,t.args.structure,t.args.enums),lastInsertId:s}}case"validate":{let{value:o,lastInsertId:s}=await this.interpretNode(t.args.expr,r,n,i);return bu(o,t.args.rules,t.args),{value:o,lastInsertId:s}}case"if":{let{value:o}=await this.interpretNode(t.args.value,r,n,i);return Ao(o,t.args.rule)?await this.interpretNode(t.args.then,r,n,i):await this.interpretNode(t.args.else,r,n,i)}case"unit":return{value:void 0};case"diff":{let{value:o}=await this.interpretNode(t.args.from,r,n,i),{value:s}=await this.interpretNode(t.args.to,r,n,i),a=new Set(Rr(s));return{value:Rr(o).filter(l=>!a.has(l))}}case"distinctBy":{let{value:o,lastInsertId:s}=await this.interpretNode(t.args.expr,r,n,i),a=new Set,l=[];for(let u of Rr(o)){let c=Bn(u,t.args.fields);a.has(c)||(a.add(c),l.push(u))}return{value:l,lastInsertId:s}}case"paginate":{let{value:o,lastInsertId:s}=await this.interpretNode(t.args.expr,r,n,i),a=Rr(o),l=t.args.pagination.linkingFields;if(l!==null){let u=new Map;for(let p of a){let d=Bn(p,l);u.has(d)||u.set(d,[]),u.get(d).push(p)}let c=Array.from(u.entries());return c.sort(([p],[d])=>p<d?-1:p>d?1:0),{value:c.flatMap(([,p])=>vu(p,t.args.pagination)),lastInsertId:s}}return{value:vu(a,t.args.pagination),lastInsertId:s}}case"initializeRecord":{let{lastInsertId:o}=await this.interpretNode(t.args.expr,r,n,i),s={};for(let[a,l]of Object.entries(t.args.fields))s[a]=pg(l,o,n,i);return{value:s,lastInsertId:o}}case"mapRecord":{let{value:o,lastInsertId:s}=await this.interpretNode(t.args.expr,r,n,i),a=o===null?{}:Co(o);for(let[l,u]of Object.entries(t.args.fields))a[l]=dg(u,a[l],n,i);return{value:a,lastInsertId:s}}default:L(t,`Unexpected node type: ${t.type}`)}}#a(t,r,n){return Nn({query:t,queryable:r,execute:n,tracingHelper:this.#n,onQuery:this.#t})}};function Pu(e){return Array.isArray(e)?e.length===0:e==null}function Rr(e){return Array.isArray(e)?e:[e]}function Ce(e){if(typeof e=="number")return e;if(typeof e=="string")return Number(e);throw new Error(`Expected number, got ${typeof e}`)}function Co(e){if(typeof e=="object"&&e!==null)return e;throw new Error(`Expected object, got ${typeof e}`)}function Tu(e,t){return Array.isArray(e)?e.map(r=>Tu(r,t)):typeof e=="object"&&e!==null?e[t]??null:e}function cg(e,t){for(let{joinExpr:r,childRecords:n}of t){let i=r.on.map(([a])=>a),o=r.on.map(([,a])=>a),s={};for(let a of Array.isArray(e)?e:[e]){let l=Co(a),u=Bn(l,i);s[u]||(s[u]=[]),s[u].push(l),r.isRelationUnique?l[r.parentField]=null:l[r.parentField]=[]}for(let a of Array.isArray(n)?n:[n]){if(a===null)continue;let l=Bn(Co(a),o);for(let u of s[l]??[])r.isRelationUnique?u[r.parentField]=a:u[r.parentField].push(a)}}return e}function vu(e,{cursor:t,skip:r,take:n}){let i=t!==null?e.findIndex(a=>wr(a,t)):0;if(i===-1)return[];let o=i+(r??0),s=n!==null?o+n:e.length;return e.slice(o,s)}function Bn(e,t){return JSON.stringify(t.map(r=>e[r]))}function pg(e,t,r,n){switch(e.type){case"value":return we(e.value,r,n);case"lastInsertId":return t;default:L(e,`Unexpected field initializer type: ${e.type}`)}}function dg(e,t,r,n){switch(e.type){case"set":return we(e.value,r,n);case"add":return Ce(t)+Ce(we(e.value,r,n));case"subtract":return Ce(t)-Ce(we(e.value,r,n));case"multiply":return Ce(t)*Ce(we(e.value,r,n));case"divide":{let i=Ce(t),o=Ce(we(e.value,r,n));return o===0?null:i/o}default:L(e,`Unexpected field operation type: ${e.type}`)}}async function mg(){return globalThis.crypto??await import("node:crypto")}async function Au(){return(await mg()).randomUUID()}var de=class extends Ae{name="TransactionManagerError";constructor(t,r){super("Transaction API error: "+t,"P2028",r)}},Ir=class extends de{constructor(){super("Transaction not found. Transaction ID is invalid, refers to an old closed transaction Prisma doesn't have information about anymore, or was obtained before disconnecting.")}},Qn=class extends de{constructor(t){super(`Transaction already closed: A ${t} cannot be executed on a committed transaction.`)}},Hn=class extends de{constructor(t){super(`Transaction already closed: A ${t} cannot be executed on a transaction that was rolled back.`)}},Gn=class extends de{constructor(){super("Unable to start a transaction in the given time.")}},Wn=class extends de{constructor(t,{timeout:r,timeTaken:n}){super(`A ${t} cannot be executed on an expired transaction. The timeout for this transaction was ${r} ms, however ${n} ms passed since the start of the transaction. Consider increasing the interactive transaction timeout or doing less work in the transaction`,{operation:t,timeout:r,timeTaken:n})}},Mt=class extends de{constructor(t){super(`Internal Consistency Error: ${t}`)}},Jn=class extends de{constructor(t){super(`Invalid isolation level: ${t}`,{isolationLevel:t})}};var fg=100,kr=q("prisma:client:transactionManager"),gg=()=>({sql:"COMMIT",args:[],argTypes:[]}),yg=()=>({sql:"ROLLBACK",args:[],argTypes:[]}),hg=()=>({sql:'-- Implicit "COMMIT" query via underlying driver',args:[],argTypes:[]}),wg=()=>({sql:'-- Implicit "ROLLBACK" query via underlying driver',args:[],argTypes:[]}),Or=class{transactions=new Map;closedTransactions=[];driverAdapter;transactionOptions;tracingHelper;#e;constructor({driverAdapter:t,transactionOptions:r,tracingHelper:n,onQuery:i}){this.driverAdapter=t,this.transactionOptions=r,this.tracingHelper=n,this.#e=i}async startTransaction(t){return await this.tracingHelper.runInChildSpan("start_transaction",()=>this.#r(t))}async#r(t){let r=t!==void 0?this.validateOptions(t):this.transactionOptions,n={id:await Au(),status:"waiting",timer:void 0,timeout:r.timeout,startedAt:Date.now(),transaction:void 0};this.transactions.set(n.id,n);let i=setTimeout(()=>n.status="timed_out",r.maxWait);switch(n.transaction=await this.driverAdapter.startTransaction(r.isolationLevel),clearTimeout(i),n.status){case"waiting":return n.status="running",n.timer=this.startTransactionTimeout(n.id,r.timeout),{id:n.id};case"timed_out":throw await this.closeTransaction(n,"timed_out"),new Gn;case"running":case"committed":case"rolled_back":throw new Mt(`Transaction in invalid state ${n.status} although it just finished startup.`);default:L(n.status,"Unknown transaction status.")}}async commitTransaction(t){return await this.tracingHelper.runInChildSpan("commit_transaction",async()=>{let r=this.getActiveTransaction(t,"commit");await this.closeTransaction(r,"committed")})}async rollbackTransaction(t){return await this.tracingHelper.runInChildSpan("rollback_transaction",async()=>{let r=this.getActiveTransaction(t,"rollback");await this.closeTransaction(r,"rolled_back")})}getTransaction(t,r){let n=this.getActiveTransaction(t.id,r);if(!n.transaction)throw new Ir;return n.transaction}getActiveTransaction(t,r){let n=this.transactions.get(t);if(!n){let i=this.closedTransactions.find(o=>o.id===t);if(i)switch(kr("Transaction already closed.",{transactionId:t,status:i.status}),i.status){case"waiting":case"running":throw new Mt("Active transaction found in closed transactions list.");case"committed":throw new Qn(r);case"rolled_back":throw new Hn(r);case"timed_out":throw new Wn(r,{timeout:i.timeout,timeTaken:Date.now()-i.startedAt})}else throw kr("Transaction not found.",t),new Ir}if(["committed","rolled_back","timed_out"].includes(n.status))throw new Mt("Closed transaction found in active transactions map.");return n}async cancelAllTransactions(){await Promise.allSettled([...this.transactions.values()].map(t=>this.closeTransaction(t,"rolled_back")))}startTransactionTimeout(t,r){let n=Date.now();return setTimeout(async()=>{kr("Transaction timed out.",{transactionId:t,timeoutStartedAt:n,timeout:r});let i=this.transactions.get(t);i&&["running","waiting"].includes(i.status)?await this.closeTransaction(i,"timed_out"):kr("Transaction already committed or rolled back when timeout happened.",t)},r)}async closeTransaction(t,r){kr("Closing transaction.",{transactionId:t.id,status:r}),t.status=r;try{if(t.transaction&&r==="committed")if(t.transaction.options.usePhantomQuery)await this.#t(hg(),t.transaction,()=>t.transaction.commit());else{let n=gg();await this.#t(n,t.transaction,()=>t.transaction.executeRaw(n)),await t.transaction.commit()}else if(t.transaction)if(t.transaction.options.usePhantomQuery)await this.#t(wg(),t.transaction,()=>t.transaction.rollback());else{let n=yg();await this.#t(n,t.transaction,()=>t.transaction.executeRaw(n)),await t.transaction.rollback()}}finally{clearTimeout(t.timer),t.timer=void 0,this.transactions.delete(t.id),this.closedTransactions.push(t),this.closedTransactions.length>fg&&this.closedTransactions.shift()}}validateOptions(t){if(!t.timeout)throw new de("timeout is required");if(!t.maxWait)throw new de("maxWait is required");if(t.isolationLevel==="SNAPSHOT")throw new Jn(t.isolationLevel);return{...t,timeout:t.timeout,maxWait:t.maxWait}}#t(t,r,n){return Nn({query:t,queryable:r,execute:n,tracingHelper:this.tracingHelper,onQuery:this.#e})}};var Kn="6.11.0-dev.29";var So,Cu={async loadQueryCompiler(e){let{clientVersion:t,adapter:r,compilerWasm:n}=e;if(r===void 0)throw new k(`The \`adapter\` option for \`PrismaClient\` is required in this context (${_n().prettyName})`,t);if(n===void 0)throw new k("WASM query compiler was unexpectedly `undefined`",t);return So===void 0&&(So=(async()=>{let i=await n.getRuntime(),o=await n.getQueryCompilerWasmModule();if(o==null)throw new k("The loaded wasm module was unexpectedly `undefined` or `null` once loaded",t);let s={"./query_compiler_bg.js":i},a=new WebAssembly.Instance(o,s),l=a.exports.__wbindgen_start;return i.__wbg_set_wasm(a.exports),l(),i.QueryCompiler})()),await So}};var Su="P2038",zn=q("prisma:client:clientEngine"),Iu=globalThis;Iu.PRISMA_WASM_PANIC_REGISTRY={set_message(e){throw new ne(e,Kn)}};var Ft=class{name="ClientEngine";queryCompiler;instantiateQueryCompilerPromise;QueryCompilerConstructor;queryCompilerLoader;adapterPromise;transactionManagerPromise;config;provider;datamodel;logEmitter;logQueries;logLevel;lastStartedQuery;tracingHelper;#e;constructor(t,r){if(!t.previewFeatures?.includes("driverAdapters"))throw new k("EngineType `client` requires the driverAdapters preview feature to be enabled.",t.clientVersion,Su);if(t.adapter)this.adapterPromise=t.adapter.connect(),this.provider=t.adapter.provider,zn("Using driver adapter: %O",t.adapter);else throw new k("Missing configured driver adapter. Engine type `client` requires an active driver adapter. Please check your PrismaClient initialization code.",t.clientVersion,Su);this.queryCompilerLoader=r??Cu,this.config=t,this.logQueries=t.logQueries??!1,this.logLevel=t.logLevel??"error",this.logEmitter=t.logEmitter,this.datamodel=t.inlineSchema,this.tracingHelper=t.tracingHelper,t.enableDebugLogs&&(this.logLevel="debug"),this.logQueries&&(this.#e=n=>{this.logEmitter.emit("query",{...n,params:Er(n.params),target:"ClientEngine"})}),this.transactionManagerPromise=this.adapterPromise.then(n=>new Or({driverAdapter:n,transactionOptions:{...this.config.transactionOptions,isolationLevel:this.#i(this.config.transactionOptions.isolationLevel)},tracingHelper:this.tracingHelper,onQuery:this.#e})),this.instantiateQueryCompilerPromise=this.instantiateQueryCompiler()}applyPendingMigrations(){throw new Error("Cannot call applyPendingMigrations on engine type client.")}async instantiateQueryCompiler(){if(this.queryCompiler)return;this.QueryCompilerConstructor||(this.QueryCompilerConstructor=await this.queryCompilerLoader.loadQueryCompiler(this.config));let r=(await this.adapterPromise)?.getConnectionInfo?.()??{supportsRelationJoins:!1};try{this.#n(()=>{this.queryCompiler=new this.QueryCompilerConstructor({datamodel:this.datamodel,provider:this.provider,connectionInfo:r})})}catch(n){throw this.#r(n)}}#r(t){if(t instanceof ne)return t;try{let r=JSON.parse(t.message);return new k(r.message,this.config.clientVersion,r.error_code)}catch{return t}}#t(t){if(t instanceof k)return t;if(t.code==="GenericFailure"&&t.message?.startsWith("PANIC:"))return new ne(Ru(this,t.message),this.config.clientVersion);if(t instanceof Ae)return new Q(t.message,{code:t.code,meta:t.meta,clientVersion:this.config.clientVersion});try{let r=JSON.parse(t);return new X(`${r.message}
72
- ${r.backtrace}`,{clientVersion:this.config.clientVersion})}catch{return t}}#o(t){return t instanceof ne?t:typeof t.message=="string"&&typeof t.code=="string"?new Q(t.message,{code:t.code,meta:t.meta,clientVersion:this.config.clientVersion}):t}#n(t){let r=Iu.PRISMA_WASM_PANIC_REGISTRY.set_message,n;global.PRISMA_WASM_PANIC_REGISTRY.set_message=i=>{n=i};try{return t()}finally{if(global.PRISMA_WASM_PANIC_REGISTRY.set_message=r,n)throw new ne(Ru(this,n),this.config.clientVersion)}}onBeforeExit(){throw new Error('"beforeExit" hook is not applicable to the client engine, it is only relevant and implemented for the binary engine. Please add your event listener to the `process` object directly instead.')}async start(){await this.tracingHelper.runInChildSpan("connect",()=>this.ensureStarted())}async stop(){await this.tracingHelper.runInChildSpan("disconnect",async()=>{await this.instantiateQueryCompilerPromise,await(await this.transactionManagerPromise)?.cancelAllTransactions(),await(await this.adapterPromise).dispose()})}async ensureStarted(){let t=await this.adapterPromise,r=await this.transactionManagerPromise;return await this.instantiateQueryCompilerPromise,[t,r]}version(){return"unknown"}async transaction(t,r,n){let i,o=await this.transactionManagerPromise;try{if(t==="start"){let s=n;i=await o.startTransaction({...s,isolationLevel:this.#i(s.isolationLevel)})}else if(t==="commit"){let s=n;await o.commitTransaction(s.id)}else if(t==="rollback"){let s=n;await o.rollbackTransaction(s.id)}else fe(t,"Invalid transaction action.")}catch(s){throw this.#t(s)}return i?{id:i.id,payload:void 0}:void 0}async request(t,{traceparent:r,interactiveTransaction:n}){zn("sending request");let i=JSON.stringify(t);this.lastStartedQuery=i;let[o,s]=await this.ensureStarted().catch(l=>{throw this.#t(l)}),a;try{a=this.#n(()=>this.queryCompiler.compile(i))}catch(l){throw this.#o(l)}try{zn("query plan created",a);let l=n?s.getTransaction(n,"query"):o,u=n?{enabled:!1}:{enabled:!0,manager:s},c={},d=await Nt.forSql({transactionManager:u,placeholderValues:c,onQuery:this.#e,tracingHelper:this.tracingHelper}).run(a,l);return zn("query plan executed"),{data:{[t.action]:d}}}catch(l){throw this.#t(l)}}async requestBatch(t,{transaction:r,traceparent:n}){if(t.length===0)return[];let i=t[0].action,o=JSON.stringify(Rt(t,r));this.lastStartedQuery=o;let[,s]=await this.ensureStarted().catch(l=>{throw this.#t(l)}),a;try{a=this.queryCompiler.compileBatch(o)}catch(l){throw this.#o(l)}try{let l;if(r?.kind==="itx")l=r.options;else{let m=r?.options.isolationLevel?{...this.config.transactionOptions,isolationLevel:r.options.isolationLevel}:this.config.transactionOptions;l=await this.transaction("start",{},m)}let u={},c=Nt.forSql({transactionManager:{enabled:!1},placeholderValues:u,onQuery:this.#e,tracingHelper:this.tracingHelper}),p=s.getTransaction(l,"batch query"),d=[];switch(a.type){case"multi":{d=await Promise.all(a.plans.map((m,g)=>c.run(m,p).then(y=>({data:{[t[g].action]:y}}),y=>y)));break}case"compacted":{if(!t.every(g=>g.action===i))throw new Error("All queries in a batch must have the same action");let m=await c.run(a.plan,p);d=this.#s(m,a,i);break}}return r?.kind!=="itx"&&await this.transaction("commit",{},l),d}catch(l){throw this.#t(l)}}metrics(t){throw new Error("Method not implemented.")}#s(t,r,n){let i=t.map(s=>r.keys.reduce((a,l)=>(a[l]=qe(s[l]),a),{})),o=new Set(r.nestedSelection);return r.arguments.map(s=>{let a=i.findIndex(l=>wr(l,s));if(a===-1)return r.expectNonEmpty?new Q("An operation failed because it depends on one or more records that were required but not found",{code:"P2025",clientVersion:this.config.clientVersion}):{data:{[n]:null}};{let l=Object.entries(t[a]).filter(([u])=>o.has(u));return{data:{[n]:Object.fromEntries(l)}}}})}#i(t){switch(t){case void 0:return;case"ReadUncommitted":return"READ UNCOMMITTED";case"ReadCommitted":return"READ COMMITTED";case"RepeatableRead":return"REPEATABLE READ";case"Serializable":return"SERIALIZABLE";case"Snapshot":return"SNAPSHOT";default:throw new Q(`Inconsistent column data: Conversion failed: Invalid isolation level \`${t}\``,{code:"P2023",clientVersion:this.config.clientVersion,meta:{providedIsolationLevel:t}})}}};function Ru(e,t){return sl({binaryTarget:void 0,title:t,version:e.config.clientVersion,engineVersion:"unknown",database:e.config.activeProvider,query:e.lastStartedQuery})}function Lt({inlineDatasources:e,overrideDatasources:t,env:r,clientVersion:n}){let i,o=Object.keys(e)[0],s=e[o]?.url,a=t[o]?.url;if(o===void 0?i=void 0:a?i=a:s?.value?i=s.value:s?.fromEnvVar&&(i=r[s.fromEnvVar]),s?.fromEnvVar!==void 0&&i===void 0)throw new k(`error: Environment variable not found: ${s.fromEnvVar}.`,n);if(i===void 0)throw new k("error: Missing URL environment variable, value, or override.",n);return i}var Yn=class extends Error{clientVersion;cause;constructor(t,r){super(t),this.clientVersion=r.clientVersion,this.cause=r.cause}get[Symbol.toStringTag](){return this.name}};var ue=class extends Yn{isRetryable;constructor(t,r){super(t,r),this.isRetryable=r.isRetryable??!0}};function S(e,t){return{...e,isRetryable:t}}var $t=class extends ue{name="ForcedRetryError";code="P5001";constructor(t){super("This request must be retried",S(t,!0))}};b($t,"ForcedRetryError");var it=class extends ue{name="InvalidDatasourceError";code="P6001";constructor(t,r){super(t,S(r,!1))}};b(it,"InvalidDatasourceError");var ot=class extends ue{name="NotImplementedYetError";code="P5004";constructor(t,r){super(t,S(r,!1))}};b(ot,"NotImplementedYetError");var F=class extends ue{response;constructor(t,r){super(t,r),this.response=r.response;let n=this.response.headers.get("prisma-request-id");if(n){let i=`(The request id was: ${n})`;this.message=this.message+" "+i}}};var st=class extends F{name="SchemaMissingError";code="P5005";constructor(t){super("Schema needs to be uploaded",S(t,!0))}};b(st,"SchemaMissingError");var Ro="This request could not be understood by the server",Dr=class extends F{name="BadRequestError";code="P5000";constructor(t,r,n){super(r||Ro,S(t,!1)),n&&(this.code=n)}};b(Dr,"BadRequestError");var _r=class extends F{name="HealthcheckTimeoutError";code="P5013";logs;constructor(t,r){super("Engine not started: healthcheck timeout",S(t,!0)),this.logs=r}};b(_r,"HealthcheckTimeoutError");var Nr=class extends F{name="EngineStartupError";code="P5014";logs;constructor(t,r,n){super(r,S(t,!0)),this.logs=n}};b(Nr,"EngineStartupError");var Mr=class extends F{name="EngineVersionNotSupportedError";code="P5012";constructor(t){super("Engine version is not supported",S(t,!1))}};b(Mr,"EngineVersionNotSupportedError");var Io="Request timed out",Fr=class extends F{name="GatewayTimeoutError";code="P5009";constructor(t,r=Io){super(r,S(t,!1))}};b(Fr,"GatewayTimeoutError");var xg="Interactive transaction error",Lr=class extends F{name="InteractiveTransactionError";code="P5015";constructor(t,r=xg){super(r,S(t,!1))}};b(Lr,"InteractiveTransactionError");var bg="Request parameters are invalid",$r=class extends F{name="InvalidRequestError";code="P5011";constructor(t,r=bg){super(r,S(t,!1))}};b($r,"InvalidRequestError");var ko="Requested resource does not exist",Vr=class extends F{name="NotFoundError";code="P5003";constructor(t,r=ko){super(r,S(t,!1))}};b(Vr,"NotFoundError");var Oo="Unknown server error",Vt=class extends F{name="ServerError";code="P5006";logs;constructor(t,r,n){super(r||Oo,S(t,!0)),this.logs=n}};b(Vt,"ServerError");var Do="Unauthorized, check your connection string",qr=class extends F{name="UnauthorizedError";code="P5007";constructor(t,r=Do){super(r,S(t,!1))}};b(qr,"UnauthorizedError");var _o="Usage exceeded, retry again later",Ur=class extends F{name="UsageExceededError";code="P5008";constructor(t,r=_o){super(r,S(t,!0))}};b(Ur,"UsageExceededError");async function Pg(e){let t;try{t=await e.text()}catch{return{type:"EmptyError"}}try{let r=JSON.parse(t);if(typeof r=="string")switch(r){case"InternalDataProxyError":return{type:"DataProxyError",body:r};default:return{type:"UnknownTextError",body:r}}if(typeof r=="object"&&r!==null){if("is_panic"in r&&"message"in r&&"error_code"in r)return{type:"QueryEngineError",body:r};if("EngineNotStarted"in r||"InteractiveTransactionMisrouted"in r||"InvalidRequestError"in r){let n=Object.values(r)[0].reason;return typeof n=="string"&&!["SchemaMissing","EngineVersionNotSupported"].includes(n)?{type:"UnknownJsonError",body:r}:{type:"DataProxyError",body:r}}}return{type:"UnknownJsonError",body:r}}catch{return t===""?{type:"EmptyError"}:{type:"UnknownTextError",body:t}}}async function jr(e,t){if(e.ok)return;let r={clientVersion:t,response:e},n=await Pg(e);if(n.type==="QueryEngineError")throw new Q(n.body.message,{code:n.body.error_code,clientVersion:t});if(n.type==="DataProxyError"){if(n.body==="InternalDataProxyError")throw new Vt(r,"Internal Data Proxy error");if("EngineNotStarted"in n.body){if(n.body.EngineNotStarted.reason==="SchemaMissing")return new st(r);if(n.body.EngineNotStarted.reason==="EngineVersionNotSupported")throw new Mr(r);if("EngineStartupError"in n.body.EngineNotStarted.reason){let{msg:i,logs:o}=n.body.EngineNotStarted.reason.EngineStartupError;throw new Nr(r,i,o)}if("KnownEngineStartupError"in n.body.EngineNotStarted.reason){let{msg:i,error_code:o}=n.body.EngineNotStarted.reason.KnownEngineStartupError;throw new k(i,t,o)}if("HealthcheckTimeout"in n.body.EngineNotStarted.reason){let{logs:i}=n.body.EngineNotStarted.reason.HealthcheckTimeout;throw new _r(r,i)}}if("InteractiveTransactionMisrouted"in n.body){let i={IDParseError:"Could not parse interactive transaction ID",NoQueryEngineFoundError:"Could not find Query Engine for the specified host and transaction ID",TransactionStartError:"Could not start interactive transaction"};throw new Lr(r,i[n.body.InteractiveTransactionMisrouted.reason])}if("InvalidRequestError"in n.body)throw new $r(r,n.body.InvalidRequestError.reason)}if(e.status===401||e.status===403)throw new qr(r,qt(Do,n));if(e.status===404)return new Vr(r,qt(ko,n));if(e.status===429)throw new Ur(r,qt(_o,n));if(e.status===504)throw new Fr(r,qt(Io,n));if(e.status>=500)throw new Vt(r,qt(Oo,n));if(e.status>=400)throw new Dr(r,qt(Ro,n))}function qt(e,t){return t.type==="EmptyError"?e:`${e}: ${JSON.stringify(t)}`}function ku(e){let t=Math.pow(2,e)*50,r=Math.ceil(Math.random()*t)-Math.ceil(t/2),n=t+r;return new Promise(i=>setTimeout(()=>i(n),n))}var Me="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function Ou(e){let t=new TextEncoder().encode(e),r="",n=t.byteLength,i=n%3,o=n-i,s,a,l,u,c;for(let p=0;p<o;p=p+3)c=t[p]<<16|t[p+1]<<8|t[p+2],s=(c&16515072)>>18,a=(c&258048)>>12,l=(c&4032)>>6,u=c&63,r+=Me[s]+Me[a]+Me[l]+Me[u];return i==1?(c=t[o],s=(c&252)>>2,a=(c&3)<<4,r+=Me[s]+Me[a]+"=="):i==2&&(c=t[o]<<8|t[o+1],s=(c&64512)>>10,a=(c&1008)>>4,l=(c&15)<<2,r+=Me[s]+Me[a]+Me[l]+"="),r}function Du(e){if(!!e.generator?.previewFeatures.some(r=>r.toLowerCase().includes("metrics")))throw new k("The `metrics` preview feature is not yet available with Accelerate.\nPlease remove `metrics` from the `previewFeatures` in your schema.\n\nMore information about Accelerate: https://pris.ly/d/accelerate",e.clientVersion)}function vg(e){return e[0]*1e3+e[1]/1e6}function No(e){return new Date(vg(e))}var _u={"@prisma/debug":"workspace:*","@prisma/engines-version":"6.11.0-15.f67607f6772d3f263d40c8e233b50714bc8295cc","@prisma/fetch-engine":"workspace:*","@prisma/get-platform":"workspace:*"};var Br=class extends ue{name="RequestError";code="P5010";constructor(t,r){super(`Cannot fetch data from service:
73
- ${t}`,S(r,!0))}};b(Br,"RequestError");async function at(e,t,r=n=>n){let{clientVersion:n,...i}=t,o=r(fetch);try{return await o(e,i)}catch(s){let a=s.message??"Unknown error";throw new Br(a,{clientVersion:n,cause:s})}}var Ag=/^[1-9][0-9]*\.[0-9]+\.[0-9]+$/,Nu=q("prisma:client:dataproxyEngine");async function Cg(e,t){let r=_u["@prisma/engines-version"],n=t.clientVersion??"unknown";if(process.env.PRISMA_CLIENT_DATA_PROXY_CLIENT_VERSION||globalThis.PRISMA_CLIENT_DATA_PROXY_CLIENT_VERSION)return process.env.PRISMA_CLIENT_DATA_PROXY_CLIENT_VERSION||globalThis.PRISMA_CLIENT_DATA_PROXY_CLIENT_VERSION;if(e.includes("accelerate")&&n!=="0.0.0"&&n!=="in-memory")return n;let[i,o]=n?.split("-")??[];if(o===void 0&&Ag.test(i))return i;if(o!==void 0||n==="0.0.0"||n==="in-memory"){let[s]=r.split("-")??[],[a,l,u]=s.split("."),c=Sg(`<=${a}.${l}.${u}`),p=await at(c,{clientVersion:n});if(!p.ok)throw new Error(`Failed to fetch stable Prisma version, unpkg.com status ${p.status} ${p.statusText}, response body: ${await p.text()||"<empty body>"}`);let d=await p.text();Nu("length of body fetched from unpkg.com",d.length);let m;try{m=JSON.parse(d)}catch(g){throw console.error("JSON.parse error: body fetched from unpkg.com: ",d),g}return m.version}throw new ot("Only `major.minor.patch` versions are supported by Accelerate.",{clientVersion:n})}async function Mu(e,t){let r=await Cg(e,t);return Nu("version",r),r}function Sg(e){return encodeURI(`https://unpkg.com/prisma@${e}/package.json`)}var Fu=3,Qr=q("prisma:client:dataproxyEngine"),Mo=class{apiKey;tracingHelper;logLevel;logQueries;engineHash;constructor({apiKey:t,tracingHelper:r,logLevel:n,logQueries:i,engineHash:o}){this.apiKey=t,this.tracingHelper=r,this.logLevel=n,this.logQueries=i,this.engineHash=o}build({traceparent:t,interactiveTransaction:r}={}){let n={Authorization:`Bearer ${this.apiKey}`,"Prisma-Engine-Hash":this.engineHash};this.tracingHelper.isEnabled()&&(n.traceparent=t??this.tracingHelper.getTraceParent()),r&&(n["X-transaction-id"]=r.id);let i=this.buildCaptureSettings();return i.length>0&&(n["X-capture-telemetry"]=i.join(", ")),n}buildCaptureSettings(){let t=[];return this.tracingHelper.isEnabled()&&t.push("tracing"),this.logLevel&&t.push(this.logLevel),this.logQueries&&t.push("query"),t}},Hr=class{name="DataProxyEngine";inlineSchema;inlineSchemaHash;inlineDatasources;config;logEmitter;env;clientVersion;engineHash;tracingHelper;remoteClientVersion;host;headerBuilder;startPromise;protocol;constructor(t){Du(t),this.config=t,this.env={...t.env,...typeof process<"u"?process.env:{}},this.inlineSchema=Ou(t.inlineSchema),this.inlineDatasources=t.inlineDatasources,this.inlineSchemaHash=t.inlineSchemaHash,this.clientVersion=t.clientVersion,this.engineHash=t.engineVersion,this.logEmitter=t.logEmitter,this.tracingHelper=t.tracingHelper}apiKey(){return this.headerBuilder.apiKey}version(){return this.engineHash}async start(){this.startPromise!==void 0&&await this.startPromise,this.startPromise=(async()=>{let{apiKey:t,url:r}=this.getURLAndAPIKey();this.host=r.host,this.headerBuilder=new Mo({apiKey:t,tracingHelper:this.tracingHelper,logLevel:this.config.logLevel,logQueries:this.config.logQueries,engineHash:this.engineHash}),this.protocol=di(r)?"http":"https",this.remoteClientVersion=await Mu(this.host,this.config),Qr("host",this.host),Qr("protocol",this.protocol)})(),await this.startPromise}async stop(){}propagateResponseExtensions(t){t?.logs?.length&&t.logs.forEach(r=>{switch(r.level){case"debug":case"trace":Qr(r);break;case"error":case"warn":case"info":{this.logEmitter.emit(r.level,{timestamp:No(r.timestamp),message:r.attributes.message??"",target:r.target});break}case"query":{this.logEmitter.emit("query",{query:r.attributes.query??"",timestamp:No(r.timestamp),duration:r.attributes.duration_ms??0,params:r.attributes.params??"",target:r.target});break}default:r.level}}),t?.traces?.length&&this.tracingHelper.dispatchEngineSpans(t.traces)}onBeforeExit(){throw new Error('"beforeExit" hook is not applicable to the remote query engine')}async url(t){return await this.start(),`${this.protocol}://${this.host}/${this.remoteClientVersion}/${this.inlineSchemaHash}/${t}`}async uploadSchema(){let t={name:"schemaUpload",internal:!0};return this.tracingHelper.runInChildSpan(t,async()=>{let r=await at(await this.url("schema"),{method:"PUT",headers:this.headerBuilder.build(),body:this.inlineSchema,clientVersion:this.clientVersion});r.ok||Qr("schema response status",r.status);let n=await jr(r,this.clientVersion);if(n)throw this.logEmitter.emit("warn",{message:`Error while uploading schema: ${n.message}`,timestamp:new Date,target:""}),n;this.logEmitter.emit("info",{message:`Schema (re)uploaded (hash: ${this.inlineSchemaHash})`,timestamp:new Date,target:""})})}request(t,{traceparent:r,interactiveTransaction:n,customDataProxyFetch:i}){return this.requestInternal({body:t,traceparent:r,interactiveTransaction:n,customDataProxyFetch:i})}async requestBatch(t,{traceparent:r,transaction:n,customDataProxyFetch:i}){let o=n?.kind==="itx"?n.options:void 0,s=Rt(t,n);return(await this.requestInternal({body:s,customDataProxyFetch:i,interactiveTransaction:o,traceparent:r})).map(l=>(l.extensions&&this.propagateResponseExtensions(l.extensions),"errors"in l?this.convertProtocolErrorsToClientError(l.errors):l))}requestInternal({body:t,traceparent:r,customDataProxyFetch:n,interactiveTransaction:i}){return this.withRetry({actionGerund:"querying",callback:async({logHttpCall:o})=>{let s=i?`${i.payload.endpoint}/graphql`:await this.url("graphql");o(s);let a=await at(s,{method:"POST",headers:this.headerBuilder.build({traceparent:r,interactiveTransaction:i}),body:JSON.stringify(t),clientVersion:this.clientVersion},n);a.ok||Qr("graphql response status",a.status),await this.handleError(await jr(a,this.clientVersion));let l=await a.json();if(l.extensions&&this.propagateResponseExtensions(l.extensions),"errors"in l)throw this.convertProtocolErrorsToClientError(l.errors);return"batchResult"in l?l.batchResult:l}})}async transaction(t,r,n){let i={start:"starting",commit:"committing",rollback:"rolling back"};return this.withRetry({actionGerund:`${i[t]} transaction`,callback:async({logHttpCall:o})=>{if(t==="start"){let s=JSON.stringify({max_wait:n.maxWait,timeout:n.timeout,isolation_level:n.isolationLevel}),a=await this.url("transaction/start");o(a);let l=await at(a,{method:"POST",headers:this.headerBuilder.build({traceparent:r.traceparent}),body:s,clientVersion:this.clientVersion});await this.handleError(await jr(l,this.clientVersion));let u=await l.json(),{extensions:c}=u;c&&this.propagateResponseExtensions(c);let p=u.id,d=u["data-proxy"].endpoint;return{id:p,payload:{endpoint:d}}}else{let s=`${n.payload.endpoint}/${t}`;o(s);let a=await at(s,{method:"POST",headers:this.headerBuilder.build({traceparent:r.traceparent}),clientVersion:this.clientVersion});await this.handleError(await jr(a,this.clientVersion));let l=await a.json(),{extensions:u}=l;u&&this.propagateResponseExtensions(u);return}}})}getURLAndAPIKey(){let t={clientVersion:this.clientVersion},r=Object.keys(this.inlineDatasources)[0],n=Lt({inlineDatasources:this.inlineDatasources,overrideDatasources:this.config.overrideDatasources,clientVersion:this.clientVersion,env:this.env}),i;try{i=new URL(n)}catch{throw new it(`Error validating datasource \`${r}\`: the URL must start with the protocol \`prisma://\``,t)}let{protocol:o,searchParams:s}=i;if(o!=="prisma:"&&o!==Kr)throw new it(`Error validating datasource \`${r}\`: the URL must start with the protocol \`prisma://\` or \`prisma+postgres://\``,t);let a=s.get("api_key");if(a===null||a.length<1)throw new it(`Error validating datasource \`${r}\`: the URL must contain a valid API key`,t);return{apiKey:a,url:i}}metrics(){throw new ot("Metrics are not yet supported for Accelerate",{clientVersion:this.clientVersion})}async withRetry(t){for(let r=0;;r++){let n=i=>{this.logEmitter.emit("info",{message:`Calling ${i} (n=${r})`,timestamp:new Date,target:""})};try{return await t.callback({logHttpCall:n})}catch(i){if(!(i instanceof ue)||!i.isRetryable)throw i;if(r>=Fu)throw i instanceof $t?i.cause:i;this.logEmitter.emit("warn",{message:`Attempt ${r+1}/${Fu} failed for ${t.actionGerund}: ${i.message??"(unknown)"}`,timestamp:new Date,target:""});let o=await ku(r);this.logEmitter.emit("warn",{message:`Retrying after ${o}ms`,timestamp:new Date,target:""})}}}async handleError(t){if(t instanceof st)throw await this.uploadSchema(),new $t({clientVersion:this.clientVersion,cause:t});if(t)throw t}convertProtocolErrorsToClientError(t){return t.length===1?kn(t[0],this.config.clientVersion,this.config.activeProvider):new X(JSON.stringify(t),{clientVersion:this.config.clientVersion})}applyPendingMigrations(){throw new Error("Method not implemented.")}};function Lu({url:e,adapter:t,copyEngine:r,targetBuildType:n}){let i=[],o=[],s=g=>{i.push({_tag:"warning",value:g})},a=g=>{let y=g.join(`
74
- `);o.push({_tag:"error",value:y})},l=!!e?.startsWith("prisma://")||!r,u=zr(e),c=!!t,p=l||u;!c&&r&&p&&s(["recommend--no-engine","In production, we recommend using `prisma generate --no-engine` (See: `prisma generate --help`)"]),c&&(p||n==="edge")&&(n==="edge"?a(["Prisma Client was configured to use the `adapter` option but it was imported via its `/edge` endpoint.","Please either remove the `/edge` endpoint or remove the `adapter` from the Prisma Client constructor."]):r?l&&a(["Prisma Client was configured to use the `adapter` option but the URL was a `prisma://` URL.","Please either use the `prisma://` URL or remove the `adapter` from the Prisma Client constructor."]):a(["Prisma Client was configured to use the `adapter` option but `prisma generate` was run with `--no-engine`.","Please run `prisma generate` without `--no-engine` to be able to use Prisma Client with the adapter."]));let d={accelerate:l,ppg:u,driverAdapters:c};function m(g){return g.length>0}return m(o)?{ok:!1,diagnostics:{warnings:i,errors:o},isUsing:d}:{ok:!0,diagnostics:{warnings:i},isUsing:d}}function $u({copyEngine:e=!0},t){let r;try{r=Lt({inlineDatasources:t.inlineDatasources,overrideDatasources:t.overrideDatasources,env:{...t.env,...process.env},clientVersion:t.clientVersion})}catch{}let{ok:n,isUsing:i,diagnostics:o}=Lu({url:r,adapter:t.adapter,copyEngine:e,targetBuildType:"client"});for(let c of o.warnings)Xt(...c.value);if(!n){let c=o.errors[0];throw new ee(c.value,{clientVersion:t.clientVersion})}let s=pt(t.generator),a=s==="library",l=s==="binary",u=s==="client";return i.accelerate?new Hr(t):(i.driverAdapters,i.accelerate,u?new Ft(t):new Ft(t))}function Zn({generator:e}){return e?.previewFeatures??[]}var Vu=e=>({command:e});var qu=e=>e.strings.reduce((t,r,n)=>`${t}@P${n}${r}`);function Ut(e){try{return Uu(e,"fast")}catch{return Uu(e,"slow")}}function Uu(e,t){return JSON.stringify(e.map(r=>Bu(r,t)))}function Bu(e,t){if(Array.isArray(e))return e.map(r=>Bu(r,t));if(typeof e=="bigint")return{prisma__type:"bigint",prisma__value:e.toString()};if(yt(e))return{prisma__type:"date",prisma__value:e.toJSON()};if(K.isDecimal(e))return{prisma__type:"decimal",prisma__value:e.toJSON()};if(Buffer.isBuffer(e))return{prisma__type:"bytes",prisma__value:e.toString("base64")};if(Rg(e))return{prisma__type:"bytes",prisma__value:Buffer.from(e).toString("base64")};if(ArrayBuffer.isView(e)){let{buffer:r,byteOffset:n,byteLength:i}=e;return{prisma__type:"bytes",prisma__value:Buffer.from(r,n,i).toString("base64")}}return typeof e=="object"&&t==="slow"?Qu(e):e}function Rg(e){return e instanceof ArrayBuffer||e instanceof SharedArrayBuffer?!0:typeof e=="object"&&e!==null?e[Symbol.toStringTag]==="ArrayBuffer"||e[Symbol.toStringTag]==="SharedArrayBuffer":!1}function Qu(e){if(typeof e!="object"||e===null)return e;if(typeof e.toJSON=="function")return e.toJSON();if(Array.isArray(e))return e.map(ju);let t={};for(let r of Object.keys(e))t[r]=ju(e[r]);return t}function ju(e){return typeof e=="bigint"?e.toString():Qu(e)}var Ig=/^(\s*alter\s)/i,Hu=q("prisma:client");function Fo(e,t,r,n){if(!(e!=="postgresql"&&e!=="cockroachdb")&&r.length>0&&Ig.exec(t))throw new Error(`Running ALTER using ${n} is not supported
71
+ `}function L(e,t){throw new Error(t)}function Gi(e,t){return e===t||e!==null&&t!==null&&typeof e=="object"&&typeof t=="object"&&Object.keys(e).length===Object.keys(t).length&&Object.keys(e).every(r=>Gi(e[r],t[r]))}function wr(e,t){let r=Object.keys(e),n=Object.keys(t);return(r.length<n.length?r:n).every(o=>{if(typeof e[o]!=typeof t[o]){if(typeof e[o]=="number"||typeof t[o]=="number")return`${e[o]}`==`${t[o]}`;if(typeof e[o]=="bigint"||typeof t[o]=="bigint")return BigInt(`${e[o]}`.replace(/n$/,""))===BigInt(`${t[o]}`.replace(/n$/,""));if(e[o]instanceof Date||t[o]instanceof Date)return new Date(`${e[o]}`).getTime()===new Date(`${t[o]}`).getTime();if(K.isDecimal(e[o])||K.isDecimal(t[o]))return new K(`${e[o]}`).equals(new K(`${t[o]}`))}return Gi(e[o],t[o])})}function Er(e){return JSON.stringify(e,(t,r)=>typeof r=="bigint"?r.toString():r instanceof Uint8Array?Buffer.from(r).toString("base64"):r)}var V=class extends Error{name="DataMapperError"};function ul(e,t,r){switch(t.type){case"AffectedRows":if(typeof e!="number")throw new V(`Expected an affected rows count, got: ${typeof e} (${e})`);return{count:e};case"Object":return Wi(e,t.fields,r);case"Value":return Ji(e,"<result>",t.resultType,r);default:L(t,`Invalid data mapping type: '${t.type}'`)}}function Wi(e,t,r){if(e===null)return null;if(Array.isArray(e))return e.map(i=>al(i,t,r));if(typeof e=="object")return al(e,t,r);if(typeof e=="string"){let n;try{n=JSON.parse(e)}catch(i){throw new V("Expected an array or object, got a string that is not valid JSON",{cause:i})}return Wi(n,t,r)}throw new V(`Expected an array or an object, got: ${typeof e}`)}function al(e,t,r){if(typeof e!="object")throw new V(`Expected an object, but got '${typeof e}'`);let n={};for(let[i,o]of Object.entries(t))switch(o.type){case"AffectedRows":throw new V(`Unexpected 'AffectedRows' node in data mapping for field '${i}'`);case"Object":{if(!o.flattened&&!Object.hasOwn(e,i))throw new V(`Missing data field (Object): '${i}'; node: ${JSON.stringify(o)}; data: ${JSON.stringify(e)}`);let s=o.flattened?e:e[i];n[i]=Wi(s,o.fields,r);break}case"Value":{let s=o.dbName;if(Object.hasOwn(e,s))n[i]=Ji(e[s],s,o.resultType,r);else throw new V(`Missing data field (Value): '${s}'; node: ${JSON.stringify(o)}; data: ${JSON.stringify(e)}`)}break;default:L(o,`DataMapper: Invalid data mapping node type: '${o.type}'`)}return n}function Ji(e,t,r,n){if(e===null)return r.type==="Array"?[]:null;switch(r.type){case"Any":return e;case"String":{if(typeof e!="string")throw new V(`Expected a string in column '${t}', got ${typeof e}: ${e}`);return e}case"Int":switch(typeof e){case"number":return Math.trunc(e);case"string":{let i=Math.trunc(Number(e));if(Number.isNaN(i)||!Number.isFinite(i))throw new V(`Expected an integer in column '${t}', got string: ${e}`);if(!Number.isSafeInteger(i))throw new V(`Integer value in column '${t}' is too large to represent as a JavaScript number without loss of precision, got: ${e}. Consider using BigInt type.`);return i}default:throw new V(`Expected an integer in column '${t}', got ${typeof e}: ${e}`)}case"BigInt":{if(typeof e!="number"&&typeof e!="string")throw new V(`Expected a bigint in column '${t}', got ${typeof e}: ${e}`);return{$type:"BigInt",value:e}}case"Float":{if(typeof e=="number")return e;if(typeof e=="string"){let i=Number(e);if(Number.isNaN(i)&&!/^[-+]?nan$/.test(e.toLowerCase()))throw new V(`Expected a float in column '${t}', got string: ${e}`);return i}throw new V(`Expected a float in column '${t}', got ${typeof e}: ${e}`)}case"Boolean":{if(typeof e=="boolean")return e;if(typeof e=="number")return e===1;if(typeof e=="string"){if(e==="true"||e==="TRUE"||e==="1")return!0;if(e==="false"||e==="FALSE"||e==="0")return!1;throw new V(`Expected a boolean in column '${t}', got ${typeof e}: ${e}`)}throw new V(`Expected a boolean in column '${t}', got ${typeof e}: ${e}`)}case"Decimal":if(typeof e!="number"&&typeof e!="string"&&!K.isDecimal(e))throw new V(`Expected a decimal in column '${t}', got ${typeof e}: ${e}`);return{$type:"Decimal",value:e};case"Date":{if(typeof e=="string")return{$type:"DateTime",value:ll(e)};if(typeof e=="number"||e instanceof Date)return{$type:"DateTime",value:e};throw new V(`Expected a date in column '${t}', got ${typeof e}: ${e}`)}case"Time":{if(typeof e=="string")return{$type:"DateTime",value:`1970-01-01T${ll(e)}`};throw new V(`Expected a time in column '${t}', got ${typeof e}: ${e}`)}case"Array":return e.map((o,s)=>Ji(o,`${t}[${s}]`,r.inner,n));case"Object":return{$type:"Json",value:typeof e=="string"?e:Er(e)};case"Bytes":{if(typeof e=="string"&&e.startsWith("\\x"))return{$type:"Bytes",value:Buffer.from(e.slice(2),"hex").toString("base64")};if(Array.isArray(e))return{$type:"Bytes",value:Buffer.from(e).toString("base64")};throw new V(`Expected a byte array in column '${t}', got ${typeof e}: ${e}`)}case"Enum":{let i=n[r.inner];if(i===void 0)throw new V(`Unknown enum '${r.inner}'`);let o=i[`${e}`];if(o===void 0)throw new V(`Unknown enum value '${e}' for enum '${r.inner}'`);return o}default:L(r,`DataMapper: Unknown result type: ${r.type}`)}}var Ym=/Z$|(?<!\d{4}-\d{2})[+-]\d{2}(:?\d{2})?$/;function ll(e){let t=Ym.exec(e);return t===null?`${e}Z`:t[0]!=="Z"&&t[1]===void 0?`${e}:00`:e}var xr;(function(e){e[e.INTERNAL=0]="INTERNAL",e[e.SERVER=1]="SERVER",e[e.CLIENT=2]="CLIENT",e[e.PRODUCER=3]="PRODUCER",e[e.CONSUMER=4]="CONSUMER"})(xr||(xr={}));function Zm(e){switch(e){case"postgres":return"postgresql";case"mysql":return"mysql";case"sqlite":return"sqlite";case"sqlserver":return"mssql";default:L(e,`Unknown provider: ${e}`)}}async function Nn({query:e,queryable:t,tracingHelper:r,onQuery:n,execute:i}){return await r.runInChildSpan({name:"db_query",kind:xr.CLIENT,attributes:{"db.query.text":e.sql,"db.system.name":Zm(t.provider)}},async()=>{let o=new Date,s=performance.now(),a=await i(),l=performance.now();return n?.({timestamp:o,duration:l-s,query:e.sql,params:e.args}),a})}function Ki(e){return e.name==="DriverAdapterError"&&typeof e.cause=="object"}var A={Int32:0,Int64:1,Float:2,Double:3,Numeric:4,Boolean:5,Character:6,Text:7,Date:8,Time:9,DateTime:10,Json:11,Enum:12,Bytes:13,Set:14,Uuid:15,Int32Array:64,Int64Array:65,FloatArray:66,DoubleArray:67,NumericArray:68,BooleanArray:69,CharacterArray:70,TextArray:71,DateArray:72,TimeArray:73,DateTimeArray:74,JsonArray:75,EnumArray:76,BytesArray:77,UuidArray:78,UnknownNumber:128};var Ae=class extends Error{name="UserFacingError";code;meta;constructor(t,r,n){super(t),this.code=r,this.meta=n??{}}toQueryResponseErrorObject(){return{error:this.message,user_facing_error:{is_panic:!1,message:this.message,meta:this.meta,error_code:this.code}}}};function cl(e){if(!Ki(e))throw e;let t=Xm(e),r=ef(e);throw!t||!r?e:new Ae(r,t,{driverAdapterError:e})}function Xm(e){switch(e.cause.kind){case"AuthenticationFailed":return"P1000";case"DatabaseDoesNotExist":return"P1003";case"SocketTimeout":return"P1008";case"DatabaseAlreadyExists":return"P1009";case"DatabaseAccessDenied":return"P1010";case"TransactionAlreadyClosed":return"P1018";case"LengthMismatch":return"P2000";case"UniqueConstraintViolation":return"P2002";case"ForeignKeyConstraintViolation":return"P2003";case"UnsupportedNativeDataType":return"P2010";case"NullConstraintViolation":return"P2011";case"ValueOutOfRange":return"P2020";case"TableDoesNotExist":return"P2021";case"ColumnNotFound":return"P2022";case"InvalidIsolationLevel":case"InconsistentColumnData":return"P2023";case"MissingFullTextSearchIndex":return"P2030";case"TransactionWriteConflict":return"P2034";case"GenericJs":return"P2036";case"TooManyConnections":return"P2037";case"postgres":case"sqlite":case"mysql":case"mssql":return;default:L(e.cause,`Unknown error: ${e.cause}`)}}function ef(e){switch(e.cause.kind){case"AuthenticationFailed":return`Authentication failed against the database server, the provided database credentials for \`${e.cause.user??"(not available)"}\` are not valid`;case"DatabaseDoesNotExist":return`Database \`${e.cause.db??"(not available)"}\` does not exist on the database server`;case"SocketTimeout":return"Operation has timed out";case"DatabaseAlreadyExists":return`Database \`${e.cause.db??"(not available)"}\` already exists on the database server`;case"DatabaseAccessDenied":return`User was denied access on the database \`${e.cause.db??"(not available)"}\``;case"TransactionAlreadyClosed":return e.cause.cause;case"LengthMismatch":return`The provided value for the column is too long for the column's type. Column: ${e.cause.column??"(not available)"}`;case"UniqueConstraintViolation":return`Unique constraint failed on the ${zi(e.cause.constraint)}`;case"ForeignKeyConstraintViolation":return`Foreign key constraint violated on the ${zi(e.cause.constraint)}`;case"UnsupportedNativeDataType":return`Failed to deserialize column of type '${e.cause.type}'. If you're using $queryRaw and this column is explicitly marked as \`Unsupported\` in your Prisma schema, try casting this column to any supported Prisma type such as \`String\`.`;case"NullConstraintViolation":return`Null constraint violation on the ${zi(e.cause.constraint)}`;case"ValueOutOfRange":return`Value out of range for the type. ${e.cause.cause}`;case"TableDoesNotExist":return`The table \`${e.cause.table??"(not available)"}\` does not exist in the current database.`;case"ColumnNotFound":return`The column \`${e.cause.column??"(not available)"}\` does not exist in the current database.`;case"InvalidIsolationLevel":return`Invalid isolation level \`${e.cause.level}\``;case"InconsistentColumnData":return`Inconsistent column data: ${e.cause.cause}`;case"MissingFullTextSearchIndex":return"Cannot find a fulltext index to use for the native search, try adding a @@fulltext([Fields...]) to your schema";case"TransactionWriteConflict":return"Transaction failed due to a write conflict or a deadlock. Please retry your transaction";case"GenericJs":return`Error in external connector (id ${e.cause.id})`;case"TooManyConnections":return`Too many database connections opened: ${e.cause.cause}`;case"sqlite":case"postgres":case"mysql":case"mssql":return;default:L(e.cause,`Unknown error: ${e.cause}`)}}function zi(e){return e&&"fields"in e?`fields: (${e.fields.map(t=>`\`${t}\``).join(", ")})`:e&&"index"in e?`constraint: \`${e.index}\``:e&&"foreignKey"in e?"foreign key":"(not available)"}function Xe(e,t){var r="000000000"+e;return r.substr(r.length-t)}var pl=j(require("node:os"),1);function tf(){try{return pl.default.hostname()}catch{return process.env._CLUSTER_NETWORK_NAME_||process.env.COMPUTERNAME||"hostname"}}var dl=2,rf=Xe(process.pid.toString(36),dl),ml=tf(),nf=ml.length,of=Xe(ml.split("").reduce(function(e,t){return+e+t.charCodeAt(0)},+nf+36).toString(36),dl);function Yi(){return rf+of}function Mn(e){return typeof e=="string"&&/^c[a-z0-9]{20,32}$/.test(e)}function Zi(e){let n=Math.pow(36,4),i=0;function o(){return Xe((Math.random()*n<<0).toString(36),4)}function s(){return i=i<n?i:0,i++,i-1}function a(){var l="c",u=new Date().getTime().toString(36),c=Xe(s().toString(36),4),p=e(),d=o()+o();return l+u+c+p+d}return a.fingerprint=e,a.isCuid=Mn,a}var sf=Zi(Yi);var fl=sf;var mu=j(iu());var ao=require("node:crypto");var ou="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var Gf=128,tt,Dt;function Wf(e){!tt||tt.length<e?(tt=Buffer.allocUnsafe(e*Gf),ao.webcrypto.getRandomValues(tt),Dt=0):Dt+e>tt.length&&(ao.webcrypto.getRandomValues(tt),Dt=0),Dt+=e}function lo(e=21){Wf(e|=0);let t="";for(let r=Dt-e;r<Dt;r++)t+=ou[tt[r]&63];return t}var Cr=j(require("node:crypto"),1);var au="0123456789ABCDEFGHJKMNPQRSTVWXYZ",Sr=32;var Jf=16,lu=10,su=0xffffffffffff;var rt;(function(e){e.Base32IncorrectEncoding="B32_ENC_INVALID",e.DecodeTimeInvalidCharacter="DEC_TIME_CHAR",e.DecodeTimeValueMalformed="DEC_TIME_MALFORMED",e.EncodeTimeNegative="ENC_TIME_NEG",e.EncodeTimeSizeExceeded="ENC_TIME_SIZE_EXCEED",e.EncodeTimeValueMalformed="ENC_TIME_MALFORMED",e.PRNGDetectFailure="PRNG_DETECT",e.ULIDInvalid="ULID_INVALID",e.Unexpected="UNEXPECTED",e.UUIDInvalid="UUID_INVALID"})(rt||(rt={}));var nt=class extends Error{constructor(t,r){super(`${r} (${t})`),this.name="ULIDError",this.code=t}};function Kf(e){let t=Math.floor(e()*Sr);return t===Sr&&(t=Sr-1),au.charAt(t)}function zf(e){let t=Yf(),r=t&&(t.crypto||t.msCrypto)||(typeof Cr.default<"u"?Cr.default:null);if(typeof r?.getRandomValues=="function")return()=>{let n=new Uint8Array(1);return r.getRandomValues(n),n[0]/255};if(typeof r?.randomBytes=="function")return()=>r.randomBytes(1).readUInt8()/255;if(Cr.default?.randomBytes)return()=>Cr.default.randomBytes(1).readUInt8()/255;throw new nt(rt.PRNGDetectFailure,"Failed to find a reliable PRNG")}function Yf(){return eg()?self:typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:null}function Zf(e,t){let r="";for(;e>0;e--)r=Kf(t)+r;return r}function Xf(e,t=lu){if(isNaN(e))throw new nt(rt.EncodeTimeValueMalformed,`Time must be a number: ${e}`);if(e>su)throw new nt(rt.EncodeTimeSizeExceeded,`Cannot encode a time larger than ${su}: ${e}`);if(e<0)throw new nt(rt.EncodeTimeNegative,`Time must be positive: ${e}`);if(Number.isInteger(e)===!1)throw new nt(rt.EncodeTimeValueMalformed,`Time must be an integer: ${e}`);let r,n="";for(let i=t;i>0;i--)r=e%Sr,n=au.charAt(r)+n,e=(e-r)/Sr;return n}function eg(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}function uu(e,t){let r=t||zf(),n=!e||isNaN(e)?Date.now():e;return Xf(n,lu)+Zf(Jf,r)}var z=[];for(let e=0;e<256;++e)z.push((e+256).toString(16).slice(1));function Vn(e,t=0){return(z[e[t+0]]+z[e[t+1]]+z[e[t+2]]+z[e[t+3]]+"-"+z[e[t+4]]+z[e[t+5]]+"-"+z[e[t+6]]+z[e[t+7]]+"-"+z[e[t+8]]+z[e[t+9]]+"-"+z[e[t+10]]+z[e[t+11]]+z[e[t+12]]+z[e[t+13]]+z[e[t+14]]+z[e[t+15]]).toLowerCase()}var cu=require("node:crypto"),Un=new Uint8Array(256),qn=Un.length;function _t(){return qn>Un.length-16&&((0,cu.randomFillSync)(Un),qn=0),Un.slice(qn,qn+=16)}var pu=require("node:crypto"),uo={randomUUID:pu.randomUUID};function tg(e,t,r){if(uo.randomUUID&&!t&&!e)return uo.randomUUID();e=e||{};let n=e.random??e.rng?.()??_t();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){if(r=r||0,r<0||r+16>t.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let i=0;i<16;++i)t[r+i]=n[i];return t}return Vn(n)}var co=tg;var po={};function rg(e,t,r){let n;if(e)n=du(e.random??e.rng?.()??_t(),e.msecs,e.seq,t,r);else{let i=Date.now(),o=_t();ng(po,i,o),n=du(o,po.msecs,po.seq,t,r)}return t??Vn(n)}function ng(e,t,r){return e.msecs??=-1/0,e.seq??=0,t>e.msecs?(e.seq=r[6]<<23|r[7]<<16|r[8]<<8|r[9],e.msecs=t):(e.seq=e.seq+1|0,e.seq===0&&e.msecs++),e}function du(e,t,r,n,i=0){if(e.length<16)throw new Error("Random bytes length must be >= 16");if(!n)n=new Uint8Array(16),i=0;else if(i<0||i+16>n.length)throw new RangeError(`UUID byte range ${i}:${i+15} is out of buffer bounds`);return t??=Date.now(),r??=e[6]*127<<24|e[7]<<16|e[8]<<8|e[9],n[i++]=t/1099511627776&255,n[i++]=t/4294967296&255,n[i++]=t/16777216&255,n[i++]=t/65536&255,n[i++]=t/256&255,n[i++]=t&255,n[i++]=112|r>>>28&15,n[i++]=r>>>20&255,n[i++]=128|r>>>14&63,n[i++]=r>>>6&255,n[i++]=r<<2&255|e[10]&3,n[i++]=e[11],n[i++]=e[12],n[i++]=e[13],n[i++]=e[14],n[i++]=e[15],n}var mo=rg;var jn=class{#e={};constructor(){this.register("uuid",new ho),this.register("cuid",new yo),this.register("ulid",new wo),this.register("nanoid",new Eo),this.register("product",new xo)}snapshot(t){return Object.create(this.#e,{now:{value:t==="mysql"?new go:new fo}})}register(t,r){this.#e[t]=r}},fo=class{#e=new Date;generate(){return this.#e.toISOString()}},go=class{#e=new Date;generate(){return this.#e.toISOString().replace("T"," ").replace("Z","")}},ho=class{generate(t){if(t===4)return co();if(t===7)return mo();throw new Error("Invalid UUID generator arguments")}},yo=class{generate(t){if(t===1)return fl();if(t===2)return(0,mu.createId)();throw new Error("Invalid CUID generator arguments")}},wo=class{generate(){return uu()}},Eo=class{generate(t){if(typeof t=="number")return lo(t);if(t===void 0)return lo();throw new Error("Invalid Nanoid generator arguments")}},xo=class{generate(t,r){if(t===void 0||r===void 0)throw new Error("Invalid Product generator arguments");return Array.isArray(t)&&Array.isArray(r)?t.flatMap(n=>r.map(i=>[n,i])):Array.isArray(t)?t.map(n=>[n,r]):Array.isArray(r)?r.map(n=>[t,n]):[[t,r]]}};function bo(e){return typeof e=="object"&&e!==null&&e.prisma__type==="param"}function Po(e){return typeof e=="object"&&e!==null&&e.prisma__type==="generatorCall"}function fu(e){return typeof e=="object"&&e!==null&&e.prisma__type==="bytes"}function gu(e){return typeof e=="object"&&e!==null&&e.prisma__type==="bigint"}function To(e,t,r){let n=e.type;switch(n){case"rawSql":return yu(e.sql,hu(e.params,t,r));case"templateSql":return ig(e.fragments,e.placeholderFormat,hu(e.params,t,r));default:L(n,"Invalid query type")}}function hu(e,t,r){return e.map(n=>we(n,t,r))}function we(e,t,r){let n=e;for(;sg(n);)if(bo(n)){let i=t[n.prisma__value.name];if(i===void 0)throw new Error(`Missing value for query variable ${n.prisma__value.name}`);n=i}else if(Po(n)){let{name:i,args:o}=n.prisma__value,s=r[i];if(!s)throw new Error(`Encountered an unknown generator '${i}'`);n=s.generate(...o.map(a=>we(a,t,r)))}else L(n,`Unexpected unevaluated value type: ${n}`);return Array.isArray(n)?n=n.map(i=>we(i,t,r)):fu(n)?n=Buffer.from(n.prisma__value,"base64"):gu(n)&&(n=BigInt(n.prisma__value)),n}function ig(e,t,r){let n=0,i=1,o=[],s=e.map(a=>{let l=a.type;switch(l){case"parameter":if(n>=r.length)throw new Error(`Malformed query template. Fragments attempt to read over ${r.length} parameters.`);return o.push(r[n++]),vo(t,i++);case"stringChunk":return a.chunk;case"parameterTuple":{if(n>=r.length)throw new Error(`Malformed query template. Fragments attempt to read over ${r.length} parameters.`);let u=r[n++],c=Array.isArray(u)?u:[u];return`(${c.length==0?"NULL":c.map(d=>(o.push(d),vo(t,i++))).join(",")})`}case"parameterTupleList":{if(n>=r.length)throw new Error(`Malformed query template. Fragments attempt to read over ${r.length} parameters.`);let u=r[n++];if(!Array.isArray(u))throw new Error("Malformed query template. Tuple list expected.");if(u.length===0)throw new Error("Malformed query template. Tuple list cannot be empty.");return u.map(p=>{if(!Array.isArray(p))throw new Error("Malformed query template. Tuple expected.");let d=p.map(f=>(o.push(f),vo(t,i++))).join(a.itemSeparator);return`${a.itemPrefix}${d}${a.itemSuffix}`}).join(a.groupSeparator)}default:L(l,"Invalid fragment type")}}).join("");return yu(s,o)}function vo(e,t){return e.hasNumbering?`${e.prefix}${t}`:e.prefix}function yu(e,t){let r=t.map(n=>og(n));return{sql:e,args:t,argTypes:r}}function og(e){return typeof e=="string"?"Text":typeof e=="number"?"Numeric":typeof e=="boolean"?"Boolean":Array.isArray(e)?"Array":Buffer.isBuffer(e)?"Bytes":"Unknown"}function sg(e){return bo(e)||Po(e)}function Eu(e){return e.rows.map(t=>t.reduce((r,n,i)=>{let o=e.columnNames[i].split("."),s=r;for(let a=0;a<o.length;a++){let l=o[a];a===o.length-1?s[l]=n:(s[l]===void 0&&(s[l]={}),s=s[l])}return r},{}))}function xu(e){let r=e.columnTypes.map(n=>wu(n)).map(n=>{switch(n){case"int":return i=>i===null?null:typeof i=="number"?i:parseInt(`${i}`,10);case"bigint":return i=>i===null?null:typeof i=="bigint"?i:BigInt(`${i}`);case"json":return i=>typeof i=="string"?JSON.parse(i):i;case"bool":return i=>typeof i=="string"?i==="true"||i==="1":typeof i=="number"?i===1:i;default:return i=>i}});return{columns:e.columnNames,types:e.columnTypes.map(n=>wu(n)),rows:e.rows.map(n=>n.map((i,o)=>r[o](i)))}}function wu(e){switch(e){case A.Int32:return"int";case A.Int64:return"bigint";case A.Float:return"float";case A.Double:return"double";case A.Text:return"string";case A.Enum:return"enum";case A.Bytes:return"bytes";case A.Boolean:return"bool";case A.Character:return"char";case A.Numeric:return"decimal";case A.Json:return"json";case A.Uuid:return"uuid";case A.DateTime:return"datetime";case A.Date:return"date";case A.Time:return"time";case A.Int32Array:return"int-array";case A.Int64Array:return"bigint-array";case A.FloatArray:return"float-array";case A.DoubleArray:return"double-array";case A.TextArray:return"string-array";case A.EnumArray:return"string-array";case A.BytesArray:return"bytes-array";case A.BooleanArray:return"bool-array";case A.CharacterArray:return"char-array";case A.NumericArray:return"decimal-array";case A.JsonArray:return"json-array";case A.UuidArray:return"uuid-array";case A.DateTimeArray:return"datetime-array";case A.DateArray:return"date-array";case A.TimeArray:return"time-array";case A.UnknownNumber:return"unknown";case A.Set:return"string";default:L(e,`Unexpected column type: ${e}`)}}function bu(e,t,r){if(!t.every(n=>Ao(e,n))){let n=ag(e,r),i=lg(r);throw new Ae(n,i,r.context)}}function Ao(e,t){switch(t.type){case"rowCountEq":return Array.isArray(e)?e.length===t.args:e===null?t.args===0:t.args===1;case"rowCountNeq":return Array.isArray(e)?e.length!==t.args:e===null?t.args!==0:t.args!==1;case"affectedRowCountEq":return e===t.args;case"never":return!1;default:L(t,`Unknown rule type: ${t.type}`)}}function ag(e,t){switch(t.error_identifier){case"RELATION_VIOLATION":return`The change you are trying to make would violate the required relation '${t.context.relation}' between the \`${t.context.modelA}\` and \`${t.context.modelB}\` models.`;case"MISSING_RECORD":return`An operation failed because it depends on one or more records that were required but not found. No record was found for ${t.context.operation}.`;case"MISSING_RELATED_RECORD":{let r=t.context.neededFor?` (needed to ${t.context.neededFor})`:"";return`An operation failed because it depends on one or more records that were required but not found. No '${t.context.model}' record${r} was found for ${t.context.operation} on ${t.context.relationType} relation '${t.context.relation}'.`}case"INCOMPLETE_CONNECT_INPUT":return`An operation failed because it depends on one or more records that were required but not found. Expected ${t.context.expectedRows} records to be connected, found only ${Array.isArray(e)?e.length:e}.`;case"INCOMPLETE_CONNECT_OUTPUT":return`The required connected records were not found. Expected ${t.context.expectedRows} records to be connected after connect operation on ${t.context.relationType} relation '${t.context.relation}', found ${Array.isArray(e)?e.length:e}.`;case"RECORDS_NOT_CONNECTED":return`The records for relation \`${t.context.relation}\` between the \`${t.context.parent}\` and \`${t.context.child}\` models are not connected.`;default:L(t,`Unknown error identifier: ${t}`)}}function lg(e){switch(e.error_identifier){case"RELATION_VIOLATION":return"P2014";case"RECORDS_NOT_CONNECTED":return"P2017";case"INCOMPLETE_CONNECT_OUTPUT":return"P2018";case"MISSING_RECORD":case"MISSING_RELATED_RECORD":case"INCOMPLETE_CONNECT_INPUT":return"P2025";default:L(e,`Unknown error identifier: ${e}`)}}var Nt=class e{#e;#r;#t;#o=new jn;#n;#s;#i;constructor({transactionManager:t,placeholderValues:r,onQuery:n,tracingHelper:i,serializer:o,rawSerializer:s}){this.#e=t,this.#r=r,this.#t=n,this.#n=i,this.#s=o,this.#i=s??o}static forSql(t){return new e({transactionManager:t.transactionManager,placeholderValues:t.placeholderValues,onQuery:t.onQuery,tracingHelper:t.tracingHelper,serializer:Eu,rawSerializer:xu})}async run(t,r){let{value:n}=await this.interpretNode(t,r,this.#r,this.#o.snapshot(r.provider)).catch(i=>cl(i));return n}async interpretNode(t,r,n,i){switch(t.type){case"value":return{value:we(t.args,n,i)};case"seq":{let o;for(let s of t.args)o=await this.interpretNode(s,r,n,i);return o??{value:void 0}}case"get":return{value:n[t.args.name]};case"let":{let o=Object.create(n);for(let s of t.args.bindings){let{value:a}=await this.interpretNode(s.expr,r,o,i);o[s.name]=a}return this.interpretNode(t.args.expr,r,o,i)}case"getFirstNonEmpty":{for(let o of t.args.names){let s=n[o];if(!Pu(s))return{value:s}}return{value:[]}}case"concat":{let o=await Promise.all(t.args.map(s=>this.interpretNode(s,r,n,i).then(a=>a.value)));return{value:o.length>0?o.reduce((s,a)=>s.concat(Rr(a)),[]):[]}}case"sum":{let o=await Promise.all(t.args.map(s=>this.interpretNode(s,r,n,i).then(a=>a.value)));return{value:o.length>0?o.reduce((s,a)=>Ce(s)+Ce(a)):0}}case"execute":{let o=To(t.args,n,i);return this.#a(o,r,async()=>({value:await r.executeRaw(o)}))}case"query":{let o=To(t.args,n,i);return this.#a(o,r,async()=>{let s=await r.queryRaw(o);return t.args.type==="rawSql"?{value:this.#i(s),lastInsertId:s.lastInsertId}:{value:this.#s(s),lastInsertId:s.lastInsertId}})}case"reverse":{let{value:o,lastInsertId:s}=await this.interpretNode(t.args,r,n,i);return{value:Array.isArray(o)?o.reverse():o,lastInsertId:s}}case"unique":{let{value:o,lastInsertId:s}=await this.interpretNode(t.args,r,n,i);if(!Array.isArray(o))return{value:o,lastInsertId:s};if(o.length>1)throw new Error(`Expected zero or one element, got ${o.length}`);return{value:o[0]??null,lastInsertId:s}}case"required":{let{value:o,lastInsertId:s}=await this.interpretNode(t.args,r,n,i);if(Pu(o))throw new Error("Required value is empty");return{value:o,lastInsertId:s}}case"mapField":{let{value:o,lastInsertId:s}=await this.interpretNode(t.args.records,r,n,i);return{value:Tu(o,t.args.field),lastInsertId:s}}case"join":{let{value:o,lastInsertId:s}=await this.interpretNode(t.args.parent,r,n,i);if(o===null)return{value:null,lastInsertId:s};let a=await Promise.all(t.args.children.map(async l=>({joinExpr:l,childRecords:(await this.interpretNode(l.child,r,n,i)).value})));return{value:ug(o,a),lastInsertId:s}}case"transaction":{if(!this.#e.enabled)return this.interpretNode(t.args,r,n,i);let o=this.#e.manager,s=await o.startTransaction(),a=o.getTransaction(s,"query");try{let l=await this.interpretNode(t.args,a,n,i);return await o.commitTransaction(s.id),l}catch(l){throw await o.rollbackTransaction(s.id),l}}case"dataMap":{let{value:o,lastInsertId:s}=await this.interpretNode(t.args.expr,r,n,i);return{value:ul(o,t.args.structure,t.args.enums),lastInsertId:s}}case"validate":{let{value:o,lastInsertId:s}=await this.interpretNode(t.args.expr,r,n,i);return bu(o,t.args.rules,t.args),{value:o,lastInsertId:s}}case"if":{let{value:o}=await this.interpretNode(t.args.value,r,n,i);return Ao(o,t.args.rule)?await this.interpretNode(t.args.then,r,n,i):await this.interpretNode(t.args.else,r,n,i)}case"unit":return{value:void 0};case"diff":{let{value:o}=await this.interpretNode(t.args.from,r,n,i),{value:s}=await this.interpretNode(t.args.to,r,n,i),a=new Set(Rr(s));return{value:Rr(o).filter(l=>!a.has(l))}}case"distinctBy":{let{value:o,lastInsertId:s}=await this.interpretNode(t.args.expr,r,n,i),a=new Set,l=[];for(let u of Rr(o)){let c=Bn(u,t.args.fields);a.has(c)||(a.add(c),l.push(u))}return{value:l,lastInsertId:s}}case"paginate":{let{value:o,lastInsertId:s}=await this.interpretNode(t.args.expr,r,n,i),a=Rr(o),l=t.args.pagination.linkingFields;if(l!==null){let u=new Map;for(let p of a){let d=Bn(p,l);u.has(d)||u.set(d,[]),u.get(d).push(p)}let c=Array.from(u.entries());return c.sort(([p],[d])=>p<d?-1:p>d?1:0),{value:c.flatMap(([,p])=>vu(p,t.args.pagination)),lastInsertId:s}}return{value:vu(a,t.args.pagination),lastInsertId:s}}case"initializeRecord":{let{lastInsertId:o}=await this.interpretNode(t.args.expr,r,n,i),s={};for(let[a,l]of Object.entries(t.args.fields))s[a]=cg(l,o,n,i);return{value:s,lastInsertId:o}}case"mapRecord":{let{value:o,lastInsertId:s}=await this.interpretNode(t.args.expr,r,n,i),a=o===null?{}:Co(o);for(let[l,u]of Object.entries(t.args.fields))a[l]=pg(u,a[l],n,i);return{value:a,lastInsertId:s}}default:L(t,`Unexpected node type: ${t.type}`)}}#a(t,r,n){return Nn({query:t,queryable:r,execute:n,tracingHelper:this.#n,onQuery:this.#t})}};function Pu(e){return Array.isArray(e)?e.length===0:e==null}function Rr(e){return Array.isArray(e)?e:[e]}function Ce(e){if(typeof e=="number")return e;if(typeof e=="string")return Number(e);throw new Error(`Expected number, got ${typeof e}`)}function Co(e){if(typeof e=="object"&&e!==null)return e;throw new Error(`Expected object, got ${typeof e}`)}function Tu(e,t){return Array.isArray(e)?e.map(r=>Tu(r,t)):typeof e=="object"&&e!==null?e[t]??null:e}function ug(e,t){for(let{joinExpr:r,childRecords:n}of t){let i=r.on.map(([a])=>a),o=r.on.map(([,a])=>a),s={};for(let a of Array.isArray(e)?e:[e]){let l=Co(a),u=Bn(l,i);s[u]||(s[u]=[]),s[u].push(l),r.isRelationUnique?l[r.parentField]=null:l[r.parentField]=[]}for(let a of Array.isArray(n)?n:[n]){if(a===null)continue;let l=Bn(Co(a),o);for(let u of s[l]??[])r.isRelationUnique?u[r.parentField]=a:u[r.parentField].push(a)}}return e}function vu(e,{cursor:t,skip:r,take:n}){let i=t!==null?e.findIndex(a=>wr(a,t)):0;if(i===-1)return[];let o=i+(r??0),s=n!==null?o+n:e.length;return e.slice(o,s)}function Bn(e,t){return JSON.stringify(t.map(r=>e[r]))}function cg(e,t,r,n){switch(e.type){case"value":return we(e.value,r,n);case"lastInsertId":return t;default:L(e,`Unexpected field initializer type: ${e.type}`)}}function pg(e,t,r,n){switch(e.type){case"set":return we(e.value,r,n);case"add":return Ce(t)+Ce(we(e.value,r,n));case"subtract":return Ce(t)-Ce(we(e.value,r,n));case"multiply":return Ce(t)*Ce(we(e.value,r,n));case"divide":{let i=Ce(t),o=Ce(we(e.value,r,n));return o===0?null:i/o}default:L(e,`Unexpected field operation type: ${e.type}`)}}async function dg(){return globalThis.crypto??await import("node:crypto")}async function Au(){return(await dg()).randomUUID()}var de=class extends Ae{name="TransactionManagerError";constructor(t,r){super("Transaction API error: "+t,"P2028",r)}},Ir=class extends de{constructor(){super("Transaction not found. Transaction ID is invalid, refers to an old closed transaction Prisma doesn't have information about anymore, or was obtained before disconnecting.")}},Qn=class extends de{constructor(t){super(`Transaction already closed: A ${t} cannot be executed on a committed transaction.`)}},Hn=class extends de{constructor(t){super(`Transaction already closed: A ${t} cannot be executed on a transaction that was rolled back.`)}},Gn=class extends de{constructor(){super("Unable to start a transaction in the given time.")}},Wn=class extends de{constructor(t,{timeout:r,timeTaken:n}){super(`A ${t} cannot be executed on an expired transaction. The timeout for this transaction was ${r} ms, however ${n} ms passed since the start of the transaction. Consider increasing the interactive transaction timeout or doing less work in the transaction`,{operation:t,timeout:r,timeTaken:n})}},Mt=class extends de{constructor(t){super(`Internal Consistency Error: ${t}`)}},Jn=class extends de{constructor(t){super(`Invalid isolation level: ${t}`,{isolationLevel:t})}};var mg=100,kr=q("prisma:client:transactionManager"),fg=()=>({sql:"COMMIT",args:[],argTypes:[]}),gg=()=>({sql:"ROLLBACK",args:[],argTypes:[]}),hg=()=>({sql:'-- Implicit "COMMIT" query via underlying driver',args:[],argTypes:[]}),yg=()=>({sql:'-- Implicit "ROLLBACK" query via underlying driver',args:[],argTypes:[]}),Or=class{transactions=new Map;closedTransactions=[];driverAdapter;transactionOptions;tracingHelper;#e;constructor({driverAdapter:t,transactionOptions:r,tracingHelper:n,onQuery:i}){this.driverAdapter=t,this.transactionOptions=r,this.tracingHelper=n,this.#e=i}async startTransaction(t){return await this.tracingHelper.runInChildSpan("start_transaction",()=>this.#r(t))}async#r(t){let r=t!==void 0?this.validateOptions(t):this.transactionOptions,n={id:await Au(),status:"waiting",timer:void 0,timeout:r.timeout,startedAt:Date.now(),transaction:void 0};this.transactions.set(n.id,n),n.timer=this.startTransactionTimeout(n.id,r.maxWait);let i=await this.driverAdapter.startTransaction(r.isolationLevel);switch(n.status){case"waiting":return n.transaction=i,clearTimeout(n.timer),n.timer=void 0,n.status="running",n.timer=this.startTransactionTimeout(n.id,r.timeout),{id:n.id};case"timed_out":throw new Gn;case"running":case"committed":case"rolled_back":throw new Mt(`Transaction in invalid state ${n.status} although it just finished startup.`);default:L(n.status,"Unknown transaction status.")}}async commitTransaction(t){return await this.tracingHelper.runInChildSpan("commit_transaction",async()=>{let r=this.getActiveTransaction(t,"commit");await this.closeTransaction(r,"committed")})}async rollbackTransaction(t){return await this.tracingHelper.runInChildSpan("rollback_transaction",async()=>{let r=this.getActiveTransaction(t,"rollback");await this.closeTransaction(r,"rolled_back")})}getTransaction(t,r){let n=this.getActiveTransaction(t.id,r);if(!n.transaction)throw new Ir;return n.transaction}getActiveTransaction(t,r){let n=this.transactions.get(t);if(!n){let i=this.closedTransactions.find(o=>o.id===t);if(i)switch(kr("Transaction already closed.",{transactionId:t,status:i.status}),i.status){case"waiting":case"running":throw new Mt("Active transaction found in closed transactions list.");case"committed":throw new Qn(r);case"rolled_back":throw new Hn(r);case"timed_out":throw new Wn(r,{timeout:i.timeout,timeTaken:Date.now()-i.startedAt})}else throw kr("Transaction not found.",t),new Ir}if(["committed","rolled_back","timed_out"].includes(n.status))throw new Mt("Closed transaction found in active transactions map.");return n}async cancelAllTransactions(){await Promise.allSettled([...this.transactions.values()].map(t=>this.closeTransaction(t,"rolled_back")))}startTransactionTimeout(t,r){let n=Date.now();return setTimeout(async()=>{kr("Transaction timed out.",{transactionId:t,timeoutStartedAt:n,timeout:r});let i=this.transactions.get(t);i&&["running","waiting"].includes(i.status)?await this.closeTransaction(i,"timed_out"):kr("Transaction already committed or rolled back when timeout happened.",t)},r)}async closeTransaction(t,r){if(kr("Closing transaction.",{transactionId:t.id,status:r}),t.status=r,t.transaction&&r==="committed")if(t.transaction.options.usePhantomQuery)await this.#t(hg(),t.transaction,()=>t.transaction.commit());else{await t.transaction.commit();let n=fg();await this.#t(n,t.transaction,()=>t.transaction.executeRaw(n))}else if(t.transaction)if(t.transaction.options.usePhantomQuery)await this.#t(yg(),t.transaction,()=>t.transaction.rollback());else{await t.transaction.rollback();let n=gg();await this.#t(n,t.transaction,()=>t.transaction.executeRaw(n))}clearTimeout(t.timer),t.timer=void 0,this.transactions.delete(t.id),this.closedTransactions.push(t),this.closedTransactions.length>mg&&this.closedTransactions.shift()}validateOptions(t){if(!t.timeout)throw new de("timeout is required");if(!t.maxWait)throw new de("maxWait is required");if(t.isolationLevel==="SNAPSHOT")throw new Jn(t.isolationLevel);return{...t,timeout:t.timeout,maxWait:t.maxWait}}#t(t,r,n){return Nn({query:t,queryable:r,execute:n,tracingHelper:this.tracingHelper,onQuery:this.#e})}};var Kn="6.11.0-dev.3";var So,Cu={async loadQueryCompiler(e){let{clientVersion:t,adapter:r,compilerWasm:n}=e;if(r===void 0)throw new k(`The \`adapter\` option for \`PrismaClient\` is required in this context (${_n().prettyName})`,t);if(n===void 0)throw new k("WASM query compiler was unexpectedly `undefined`",t);return So===void 0&&(So=(async()=>{let i=await n.getRuntime(),o=await n.getQueryCompilerWasmModule();if(o==null)throw new k("The loaded wasm module was unexpectedly `undefined` or `null` once loaded",t);let s={"./query_compiler_bg.js":i},a=new WebAssembly.Instance(o,s),l=a.exports.__wbindgen_start;return i.__wbg_set_wasm(a.exports),l(),i.QueryCompiler})()),await So}};var Su="P2038",zn=q("prisma:client:clientEngine"),Iu=globalThis;Iu.PRISMA_WASM_PANIC_REGISTRY={set_message(e){throw new ne(e,Kn)}};var Ft=class{name="ClientEngine";queryCompiler;instantiateQueryCompilerPromise;QueryCompilerConstructor;queryCompilerLoader;adapterPromise;transactionManagerPromise;config;provider;datamodel;logEmitter;logQueries;logLevel;lastStartedQuery;tracingHelper;#e;constructor(t,r){if(!t.previewFeatures?.includes("driverAdapters"))throw new k("EngineType `client` requires the driverAdapters preview feature to be enabled.",t.clientVersion,Su);if(t.adapter)this.adapterPromise=t.adapter.connect(),this.provider=t.adapter.provider,zn("Using driver adapter: %O",t.adapter);else throw new k("Missing configured driver adapter. Engine type `client` requires an active driver adapter. Please check your PrismaClient initialization code.",t.clientVersion,Su);this.queryCompilerLoader=r??Cu,this.config=t,this.logQueries=t.logQueries??!1,this.logLevel=t.logLevel??"error",this.logEmitter=t.logEmitter,this.datamodel=t.inlineSchema,this.tracingHelper=t.tracingHelper,t.enableDebugLogs&&(this.logLevel="debug"),this.logQueries&&(this.#e=n=>{this.logEmitter.emit("query",{...n,params:Er(n.params),target:"ClientEngine"})}),this.transactionManagerPromise=this.adapterPromise.then(n=>new Or({driverAdapter:n,transactionOptions:{...this.config.transactionOptions,isolationLevel:this.#i(this.config.transactionOptions.isolationLevel)},tracingHelper:this.tracingHelper,onQuery:this.#e})),this.instantiateQueryCompilerPromise=this.instantiateQueryCompiler()}applyPendingMigrations(){throw new Error("Cannot call applyPendingMigrations on engine type client.")}async instantiateQueryCompiler(){if(this.queryCompiler)return;this.QueryCompilerConstructor||(this.QueryCompilerConstructor=await this.queryCompilerLoader.loadQueryCompiler(this.config));let r=(await this.adapterPromise)?.getConnectionInfo?.()??{supportsRelationJoins:!1};try{this.#n(()=>{this.queryCompiler=new this.QueryCompilerConstructor({datamodel:this.datamodel,provider:this.provider,connectionInfo:r})})}catch(n){throw this.#r(n)}}#r(t){if(t instanceof ne)return t;try{let r=JSON.parse(t.message);return new k(r.message,this.config.clientVersion,r.error_code)}catch{return t}}#t(t){if(t instanceof k)return t;if(t.code==="GenericFailure"&&t.message?.startsWith("PANIC:"))return new ne(Ru(this,t.message),this.config.clientVersion);if(t instanceof Ae)return new Q(t.message,{code:t.code,meta:t.meta,clientVersion:this.config.clientVersion});try{let r=JSON.parse(t);return new X(`${r.message}
72
+ ${r.backtrace}`,{clientVersion:this.config.clientVersion})}catch{return t}}#o(t){return t instanceof ne?t:typeof t.message=="string"&&typeof t.code=="string"?new Q(t.message,{code:t.code,meta:t.meta,clientVersion:this.config.clientVersion}):t}#n(t){let r=Iu.PRISMA_WASM_PANIC_REGISTRY.set_message,n;global.PRISMA_WASM_PANIC_REGISTRY.set_message=i=>{n=i};try{return t()}finally{if(global.PRISMA_WASM_PANIC_REGISTRY.set_message=r,n)throw new ne(Ru(this,n),this.config.clientVersion)}}onBeforeExit(){throw new Error('"beforeExit" hook is not applicable to the client engine, it is only relevant and implemented for the binary engine. Please add your event listener to the `process` object directly instead.')}async start(){await this.tracingHelper.runInChildSpan("connect",()=>this.ensureStarted())}async stop(){await this.tracingHelper.runInChildSpan("disconnect",async()=>{await this.instantiateQueryCompilerPromise,await(await this.transactionManagerPromise)?.cancelAllTransactions(),await(await this.adapterPromise).dispose()})}async ensureStarted(){let t=await this.adapterPromise,r=await this.transactionManagerPromise;return await this.instantiateQueryCompilerPromise,[t,r]}version(){return"unknown"}async transaction(t,r,n){let i,o=await this.transactionManagerPromise;try{if(t==="start"){let s=n;i=await o.startTransaction({...s,isolationLevel:this.#i(s.isolationLevel)})}else if(t==="commit"){let s=n;await o.commitTransaction(s.id)}else if(t==="rollback"){let s=n;await o.rollbackTransaction(s.id)}else fe(t,"Invalid transaction action.")}catch(s){throw this.#t(s)}return i?{id:i.id,payload:void 0}:void 0}async request(t,{traceparent:r,interactiveTransaction:n}){zn("sending request");let i=JSON.stringify(t);this.lastStartedQuery=i;let[o,s]=await this.ensureStarted().catch(l=>{throw this.#t(l)}),a;try{a=this.#n(()=>this.queryCompiler.compile(i))}catch(l){throw this.#o(l)}try{zn("query plan created",a);let l=n?s.getTransaction(n,"query"):o,u=n?{enabled:!1}:{enabled:!0,manager:s},c={},d=await Nt.forSql({transactionManager:u,placeholderValues:c,onQuery:this.#e,tracingHelper:this.tracingHelper}).run(a,l);return zn("query plan executed"),{data:{[t.action]:d}}}catch(l){throw this.#t(l)}}async requestBatch(t,{transaction:r,traceparent:n}){if(t.length===0)return[];let i=t[0].action,o=JSON.stringify(Rt(t,r));this.lastStartedQuery=o;let[,s]=await this.ensureStarted().catch(l=>{throw this.#t(l)}),a;try{a=this.queryCompiler.compileBatch(o)}catch(l){throw this.#o(l)}try{let l;if(r?.kind==="itx")l=r.options;else{let f=r?.options.isolationLevel?{...this.config.transactionOptions,isolationLevel:r.options.isolationLevel}:this.config.transactionOptions;l=await this.transaction("start",{},f)}let u={},c=Nt.forSql({transactionManager:{enabled:!1},placeholderValues:u,onQuery:this.#e,tracingHelper:this.tracingHelper}),p=s.getTransaction(l,"batch query"),d=[];switch(a.type){case"multi":{d=await Promise.all(a.plans.map((f,g)=>c.run(f,p).then(h=>({data:{[t[g].action]:h}}),h=>h)));break}case"compacted":{if(!t.every(g=>g.action===i))throw new Error("All queries in a batch must have the same action");let f=await c.run(a.plan,p);d=this.#s(f,a,i);break}}return r?.kind!=="itx"&&await this.transaction("commit",{},l),d}catch(l){throw this.#t(l)}}metrics(t){throw new Error("Method not implemented.")}#s(t,r,n){let i=t.map(s=>r.keys.reduce((a,l)=>(a[l]=qe(s[l]),a),{})),o=new Set(r.nestedSelection);return r.arguments.map(s=>{let a=i.findIndex(l=>wr(l,s));if(a===-1)return r.expectNonEmpty?new Q("An operation failed because it depends on one or more records that were required but not found",{code:"P2025",clientVersion:this.config.clientVersion}):{data:{[n]:null}};{let l=Object.entries(t[a]).filter(([u])=>o.has(u));return{data:{[n]:Object.fromEntries(l)}}}})}#i(t){switch(t){case void 0:return;case"ReadUncommitted":return"READ UNCOMMITTED";case"ReadCommitted":return"READ COMMITTED";case"RepeatableRead":return"REPEATABLE READ";case"Serializable":return"SERIALIZABLE";case"Snapshot":return"SNAPSHOT";default:throw new Q(`Inconsistent column data: Conversion failed: Invalid isolation level \`${t}\``,{code:"P2023",clientVersion:this.config.clientVersion,meta:{providedIsolationLevel:t}})}}};function Ru(e,t){return sl({binaryTarget:void 0,title:t,version:e.config.clientVersion,engineVersion:"unknown",database:e.config.activeProvider,query:e.lastStartedQuery})}function Lt({inlineDatasources:e,overrideDatasources:t,env:r,clientVersion:n}){let i,o=Object.keys(e)[0],s=e[o]?.url,a=t[o]?.url;if(o===void 0?i=void 0:a?i=a:s?.value?i=s.value:s?.fromEnvVar&&(i=r[s.fromEnvVar]),s?.fromEnvVar!==void 0&&i===void 0)throw new k(`error: Environment variable not found: ${s.fromEnvVar}.`,n);if(i===void 0)throw new k("error: Missing URL environment variable, value, or override.",n);return i}var Yn=class extends Error{clientVersion;cause;constructor(t,r){super(t),this.clientVersion=r.clientVersion,this.cause=r.cause}get[Symbol.toStringTag](){return this.name}};var ue=class extends Yn{isRetryable;constructor(t,r){super(t,r),this.isRetryable=r.isRetryable??!0}};function S(e,t){return{...e,isRetryable:t}}var $t=class extends ue{name="ForcedRetryError";code="P5001";constructor(t){super("This request must be retried",S(t,!0))}};b($t,"ForcedRetryError");var it=class extends ue{name="InvalidDatasourceError";code="P6001";constructor(t,r){super(t,S(r,!1))}};b(it,"InvalidDatasourceError");var ot=class extends ue{name="NotImplementedYetError";code="P5004";constructor(t,r){super(t,S(r,!1))}};b(ot,"NotImplementedYetError");var F=class extends ue{response;constructor(t,r){super(t,r),this.response=r.response;let n=this.response.headers.get("prisma-request-id");if(n){let i=`(The request id was: ${n})`;this.message=this.message+" "+i}}};var st=class extends F{name="SchemaMissingError";code="P5005";constructor(t){super("Schema needs to be uploaded",S(t,!0))}};b(st,"SchemaMissingError");var Ro="This request could not be understood by the server",Dr=class extends F{name="BadRequestError";code="P5000";constructor(t,r,n){super(r||Ro,S(t,!1)),n&&(this.code=n)}};b(Dr,"BadRequestError");var _r=class extends F{name="HealthcheckTimeoutError";code="P5013";logs;constructor(t,r){super("Engine not started: healthcheck timeout",S(t,!0)),this.logs=r}};b(_r,"HealthcheckTimeoutError");var Nr=class extends F{name="EngineStartupError";code="P5014";logs;constructor(t,r,n){super(r,S(t,!0)),this.logs=n}};b(Nr,"EngineStartupError");var Mr=class extends F{name="EngineVersionNotSupportedError";code="P5012";constructor(t){super("Engine version is not supported",S(t,!1))}};b(Mr,"EngineVersionNotSupportedError");var Io="Request timed out",Fr=class extends F{name="GatewayTimeoutError";code="P5009";constructor(t,r=Io){super(r,S(t,!1))}};b(Fr,"GatewayTimeoutError");var Eg="Interactive transaction error",Lr=class extends F{name="InteractiveTransactionError";code="P5015";constructor(t,r=Eg){super(r,S(t,!1))}};b(Lr,"InteractiveTransactionError");var xg="Request parameters are invalid",$r=class extends F{name="InvalidRequestError";code="P5011";constructor(t,r=xg){super(r,S(t,!1))}};b($r,"InvalidRequestError");var ko="Requested resource does not exist",Vr=class extends F{name="NotFoundError";code="P5003";constructor(t,r=ko){super(r,S(t,!1))}};b(Vr,"NotFoundError");var Oo="Unknown server error",Vt=class extends F{name="ServerError";code="P5006";logs;constructor(t,r,n){super(r||Oo,S(t,!0)),this.logs=n}};b(Vt,"ServerError");var Do="Unauthorized, check your connection string",qr=class extends F{name="UnauthorizedError";code="P5007";constructor(t,r=Do){super(r,S(t,!1))}};b(qr,"UnauthorizedError");var _o="Usage exceeded, retry again later",Ur=class extends F{name="UsageExceededError";code="P5008";constructor(t,r=_o){super(r,S(t,!0))}};b(Ur,"UsageExceededError");async function bg(e){let t;try{t=await e.text()}catch{return{type:"EmptyError"}}try{let r=JSON.parse(t);if(typeof r=="string")switch(r){case"InternalDataProxyError":return{type:"DataProxyError",body:r};default:return{type:"UnknownTextError",body:r}}if(typeof r=="object"&&r!==null){if("is_panic"in r&&"message"in r&&"error_code"in r)return{type:"QueryEngineError",body:r};if("EngineNotStarted"in r||"InteractiveTransactionMisrouted"in r||"InvalidRequestError"in r){let n=Object.values(r)[0].reason;return typeof n=="string"&&!["SchemaMissing","EngineVersionNotSupported"].includes(n)?{type:"UnknownJsonError",body:r}:{type:"DataProxyError",body:r}}}return{type:"UnknownJsonError",body:r}}catch{return t===""?{type:"EmptyError"}:{type:"UnknownTextError",body:t}}}async function jr(e,t){if(e.ok)return;let r={clientVersion:t,response:e},n=await bg(e);if(n.type==="QueryEngineError")throw new Q(n.body.message,{code:n.body.error_code,clientVersion:t});if(n.type==="DataProxyError"){if(n.body==="InternalDataProxyError")throw new Vt(r,"Internal Data Proxy error");if("EngineNotStarted"in n.body){if(n.body.EngineNotStarted.reason==="SchemaMissing")return new st(r);if(n.body.EngineNotStarted.reason==="EngineVersionNotSupported")throw new Mr(r);if("EngineStartupError"in n.body.EngineNotStarted.reason){let{msg:i,logs:o}=n.body.EngineNotStarted.reason.EngineStartupError;throw new Nr(r,i,o)}if("KnownEngineStartupError"in n.body.EngineNotStarted.reason){let{msg:i,error_code:o}=n.body.EngineNotStarted.reason.KnownEngineStartupError;throw new k(i,t,o)}if("HealthcheckTimeout"in n.body.EngineNotStarted.reason){let{logs:i}=n.body.EngineNotStarted.reason.HealthcheckTimeout;throw new _r(r,i)}}if("InteractiveTransactionMisrouted"in n.body){let i={IDParseError:"Could not parse interactive transaction ID",NoQueryEngineFoundError:"Could not find Query Engine for the specified host and transaction ID",TransactionStartError:"Could not start interactive transaction"};throw new Lr(r,i[n.body.InteractiveTransactionMisrouted.reason])}if("InvalidRequestError"in n.body)throw new $r(r,n.body.InvalidRequestError.reason)}if(e.status===401||e.status===403)throw new qr(r,qt(Do,n));if(e.status===404)return new Vr(r,qt(ko,n));if(e.status===429)throw new Ur(r,qt(_o,n));if(e.status===504)throw new Fr(r,qt(Io,n));if(e.status>=500)throw new Vt(r,qt(Oo,n));if(e.status>=400)throw new Dr(r,qt(Ro,n))}function qt(e,t){return t.type==="EmptyError"?e:`${e}: ${JSON.stringify(t)}`}function ku(e){let t=Math.pow(2,e)*50,r=Math.ceil(Math.random()*t)-Math.ceil(t/2),n=t+r;return new Promise(i=>setTimeout(()=>i(n),n))}var Me="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function Ou(e){let t=new TextEncoder().encode(e),r="",n=t.byteLength,i=n%3,o=n-i,s,a,l,u,c;for(let p=0;p<o;p=p+3)c=t[p]<<16|t[p+1]<<8|t[p+2],s=(c&16515072)>>18,a=(c&258048)>>12,l=(c&4032)>>6,u=c&63,r+=Me[s]+Me[a]+Me[l]+Me[u];return i==1?(c=t[o],s=(c&252)>>2,a=(c&3)<<4,r+=Me[s]+Me[a]+"=="):i==2&&(c=t[o]<<8|t[o+1],s=(c&64512)>>10,a=(c&1008)>>4,l=(c&15)<<2,r+=Me[s]+Me[a]+Me[l]+"="),r}function Du(e){if(!!e.generator?.previewFeatures.some(r=>r.toLowerCase().includes("metrics")))throw new k("The `metrics` preview feature is not yet available with Accelerate.\nPlease remove `metrics` from the `previewFeatures` in your schema.\n\nMore information about Accelerate: https://pris.ly/d/accelerate",e.clientVersion)}function Pg(e){return e[0]*1e3+e[1]/1e6}function No(e){return new Date(Pg(e))}var _u={"@prisma/debug":"workspace:*","@prisma/engines-version":"6.11.0-1.09706cd7c13a662843f8f7f16e6128aedbee4654","@prisma/fetch-engine":"workspace:*","@prisma/get-platform":"workspace:*"};var Br=class extends ue{name="RequestError";code="P5010";constructor(t,r){super(`Cannot fetch data from service:
73
+ ${t}`,S(r,!0))}};b(Br,"RequestError");async function at(e,t,r=n=>n){let{clientVersion:n,...i}=t,o=r(fetch);try{return await o(e,i)}catch(s){let a=s.message??"Unknown error";throw new Br(a,{clientVersion:n,cause:s})}}var Tg=/^[1-9][0-9]*\.[0-9]+\.[0-9]+$/,Nu=q("prisma:client:dataproxyEngine");async function Ag(e,t){let r=_u["@prisma/engines-version"],n=t.clientVersion??"unknown";if(process.env.PRISMA_CLIENT_DATA_PROXY_CLIENT_VERSION||globalThis.PRISMA_CLIENT_DATA_PROXY_CLIENT_VERSION)return process.env.PRISMA_CLIENT_DATA_PROXY_CLIENT_VERSION||globalThis.PRISMA_CLIENT_DATA_PROXY_CLIENT_VERSION;if(e.includes("accelerate")&&n!=="0.0.0"&&n!=="in-memory")return n;let[i,o]=n?.split("-")??[];if(o===void 0&&Tg.test(i))return i;if(o!==void 0||n==="0.0.0"||n==="in-memory"){let[s]=r.split("-")??[],[a,l,u]=s.split("."),c=Cg(`<=${a}.${l}.${u}`),p=await at(c,{clientVersion:n});if(!p.ok)throw new Error(`Failed to fetch stable Prisma version, unpkg.com status ${p.status} ${p.statusText}, response body: ${await p.text()||"<empty body>"}`);let d=await p.text();Nu("length of body fetched from unpkg.com",d.length);let f;try{f=JSON.parse(d)}catch(g){throw console.error("JSON.parse error: body fetched from unpkg.com: ",d),g}return f.version}throw new ot("Only `major.minor.patch` versions are supported by Accelerate.",{clientVersion:n})}async function Mu(e,t){let r=await Ag(e,t);return Nu("version",r),r}function Cg(e){return encodeURI(`https://unpkg.com/prisma@${e}/package.json`)}var Fu=3,Qr=q("prisma:client:dataproxyEngine"),Mo=class{apiKey;tracingHelper;logLevel;logQueries;engineHash;constructor({apiKey:t,tracingHelper:r,logLevel:n,logQueries:i,engineHash:o}){this.apiKey=t,this.tracingHelper=r,this.logLevel=n,this.logQueries=i,this.engineHash=o}build({traceparent:t,interactiveTransaction:r}={}){let n={Authorization:`Bearer ${this.apiKey}`,"Prisma-Engine-Hash":this.engineHash};this.tracingHelper.isEnabled()&&(n.traceparent=t??this.tracingHelper.getTraceParent()),r&&(n["X-transaction-id"]=r.id);let i=this.buildCaptureSettings();return i.length>0&&(n["X-capture-telemetry"]=i.join(", ")),n}buildCaptureSettings(){let t=[];return this.tracingHelper.isEnabled()&&t.push("tracing"),this.logLevel&&t.push(this.logLevel),this.logQueries&&t.push("query"),t}},Hr=class{name="DataProxyEngine";inlineSchema;inlineSchemaHash;inlineDatasources;config;logEmitter;env;clientVersion;engineHash;tracingHelper;remoteClientVersion;host;headerBuilder;startPromise;protocol;constructor(t){Du(t),this.config=t,this.env={...t.env,...typeof process<"u"?process.env:{}},this.inlineSchema=Ou(t.inlineSchema),this.inlineDatasources=t.inlineDatasources,this.inlineSchemaHash=t.inlineSchemaHash,this.clientVersion=t.clientVersion,this.engineHash=t.engineVersion,this.logEmitter=t.logEmitter,this.tracingHelper=t.tracingHelper}apiKey(){return this.headerBuilder.apiKey}version(){return this.engineHash}async start(){this.startPromise!==void 0&&await this.startPromise,this.startPromise=(async()=>{let{apiKey:t,url:r}=this.getURLAndAPIKey();this.host=r.host,this.headerBuilder=new Mo({apiKey:t,tracingHelper:this.tracingHelper,logLevel:this.config.logLevel,logQueries:this.config.logQueries,engineHash:this.engineHash}),this.protocol=di(r)?"http":"https",this.remoteClientVersion=await Mu(this.host,this.config),Qr("host",this.host),Qr("protocol",this.protocol)})(),await this.startPromise}async stop(){}propagateResponseExtensions(t){t?.logs?.length&&t.logs.forEach(r=>{switch(r.level){case"debug":case"trace":Qr(r);break;case"error":case"warn":case"info":{this.logEmitter.emit(r.level,{timestamp:No(r.timestamp),message:r.attributes.message??"",target:r.target});break}case"query":{this.logEmitter.emit("query",{query:r.attributes.query??"",timestamp:No(r.timestamp),duration:r.attributes.duration_ms??0,params:r.attributes.params??"",target:r.target});break}default:r.level}}),t?.traces?.length&&this.tracingHelper.dispatchEngineSpans(t.traces)}onBeforeExit(){throw new Error('"beforeExit" hook is not applicable to the remote query engine')}async url(t){return await this.start(),`${this.protocol}://${this.host}/${this.remoteClientVersion}/${this.inlineSchemaHash}/${t}`}async uploadSchema(){let t={name:"schemaUpload",internal:!0};return this.tracingHelper.runInChildSpan(t,async()=>{let r=await at(await this.url("schema"),{method:"PUT",headers:this.headerBuilder.build(),body:this.inlineSchema,clientVersion:this.clientVersion});r.ok||Qr("schema response status",r.status);let n=await jr(r,this.clientVersion);if(n)throw this.logEmitter.emit("warn",{message:`Error while uploading schema: ${n.message}`,timestamp:new Date,target:""}),n;this.logEmitter.emit("info",{message:`Schema (re)uploaded (hash: ${this.inlineSchemaHash})`,timestamp:new Date,target:""})})}request(t,{traceparent:r,interactiveTransaction:n,customDataProxyFetch:i}){return this.requestInternal({body:t,traceparent:r,interactiveTransaction:n,customDataProxyFetch:i})}async requestBatch(t,{traceparent:r,transaction:n,customDataProxyFetch:i}){let o=n?.kind==="itx"?n.options:void 0,s=Rt(t,n);return(await this.requestInternal({body:s,customDataProxyFetch:i,interactiveTransaction:o,traceparent:r})).map(l=>(l.extensions&&this.propagateResponseExtensions(l.extensions),"errors"in l?this.convertProtocolErrorsToClientError(l.errors):l))}requestInternal({body:t,traceparent:r,customDataProxyFetch:n,interactiveTransaction:i}){return this.withRetry({actionGerund:"querying",callback:async({logHttpCall:o})=>{let s=i?`${i.payload.endpoint}/graphql`:await this.url("graphql");o(s);let a=await at(s,{method:"POST",headers:this.headerBuilder.build({traceparent:r,interactiveTransaction:i}),body:JSON.stringify(t),clientVersion:this.clientVersion},n);a.ok||Qr("graphql response status",a.status),await this.handleError(await jr(a,this.clientVersion));let l=await a.json();if(l.extensions&&this.propagateResponseExtensions(l.extensions),"errors"in l)throw this.convertProtocolErrorsToClientError(l.errors);return"batchResult"in l?l.batchResult:l}})}async transaction(t,r,n){let i={start:"starting",commit:"committing",rollback:"rolling back"};return this.withRetry({actionGerund:`${i[t]} transaction`,callback:async({logHttpCall:o})=>{if(t==="start"){let s=JSON.stringify({max_wait:n.maxWait,timeout:n.timeout,isolation_level:n.isolationLevel}),a=await this.url("transaction/start");o(a);let l=await at(a,{method:"POST",headers:this.headerBuilder.build({traceparent:r.traceparent}),body:s,clientVersion:this.clientVersion});await this.handleError(await jr(l,this.clientVersion));let u=await l.json(),{extensions:c}=u;c&&this.propagateResponseExtensions(c);let p=u.id,d=u["data-proxy"].endpoint;return{id:p,payload:{endpoint:d}}}else{let s=`${n.payload.endpoint}/${t}`;o(s);let a=await at(s,{method:"POST",headers:this.headerBuilder.build({traceparent:r.traceparent}),clientVersion:this.clientVersion});await this.handleError(await jr(a,this.clientVersion));let l=await a.json(),{extensions:u}=l;u&&this.propagateResponseExtensions(u);return}}})}getURLAndAPIKey(){let t={clientVersion:this.clientVersion},r=Object.keys(this.inlineDatasources)[0],n=Lt({inlineDatasources:this.inlineDatasources,overrideDatasources:this.config.overrideDatasources,clientVersion:this.clientVersion,env:this.env}),i;try{i=new URL(n)}catch{throw new it(`Error validating datasource \`${r}\`: the URL must start with the protocol \`prisma://\``,t)}let{protocol:o,searchParams:s}=i;if(o!=="prisma:"&&o!==Kr)throw new it(`Error validating datasource \`${r}\`: the URL must start with the protocol \`prisma://\` or \`prisma+postgres://\``,t);let a=s.get("api_key");if(a===null||a.length<1)throw new it(`Error validating datasource \`${r}\`: the URL must contain a valid API key`,t);return{apiKey:a,url:i}}metrics(){throw new ot("Metrics are not yet supported for Accelerate",{clientVersion:this.clientVersion})}async withRetry(t){for(let r=0;;r++){let n=i=>{this.logEmitter.emit("info",{message:`Calling ${i} (n=${r})`,timestamp:new Date,target:""})};try{return await t.callback({logHttpCall:n})}catch(i){if(!(i instanceof ue)||!i.isRetryable)throw i;if(r>=Fu)throw i instanceof $t?i.cause:i;this.logEmitter.emit("warn",{message:`Attempt ${r+1}/${Fu} failed for ${t.actionGerund}: ${i.message??"(unknown)"}`,timestamp:new Date,target:""});let o=await ku(r);this.logEmitter.emit("warn",{message:`Retrying after ${o}ms`,timestamp:new Date,target:""})}}}async handleError(t){if(t instanceof st)throw await this.uploadSchema(),new $t({clientVersion:this.clientVersion,cause:t});if(t)throw t}convertProtocolErrorsToClientError(t){return t.length===1?kn(t[0],this.config.clientVersion,this.config.activeProvider):new X(JSON.stringify(t),{clientVersion:this.config.clientVersion})}applyPendingMigrations(){throw new Error("Method not implemented.")}};function Lu({copyEngine:e=!0},t){let r;try{r=Lt({inlineDatasources:t.inlineDatasources,overrideDatasources:t.overrideDatasources,env:{...t.env,...process.env},clientVersion:t.clientVersion})}catch{}let n=!!(r?.startsWith("prisma://")||zr(r));e&&n&&Xt("recommend--no-engine","In production, we recommend using `prisma generate --no-engine` (See: `prisma generate --help`)");let i=pt(t.generator),o=n||!e,s=!!t.adapter,a=i==="library",l=i==="binary",u=i==="client";if(o&&s||s&&!1){let c;throw e?r?.startsWith("prisma://")?c=["Prisma Client was configured to use the `adapter` option but the URL was a `prisma://` URL.","Please either use the `prisma://` URL or remove the `adapter` from the Prisma Client constructor."]:c=["Prisma Client was configured to use both the `adapter` and Accelerate, please chose one."]:c=["Prisma Client was configured to use the `adapter` option but `prisma generate` was run with `--no-engine`.","Please run `prisma generate` without `--no-engine` to be able to use Prisma Client with the adapter."],new ee(c.join(`
74
+ `),{clientVersion:t.clientVersion})}return o?new Hr(t):u?new Ft(t):new Ft(t)}function Zn({generator:e}){return e?.previewFeatures??[]}var $u=e=>({command:e});var Vu=e=>e.strings.reduce((t,r,n)=>`${t}@P${n}${r}`);function Ut(e){try{return qu(e,"fast")}catch{return qu(e,"slow")}}function qu(e,t){return JSON.stringify(e.map(r=>ju(r,t)))}function ju(e,t){if(Array.isArray(e))return e.map(r=>ju(r,t));if(typeof e=="bigint")return{prisma__type:"bigint",prisma__value:e.toString()};if(ht(e))return{prisma__type:"date",prisma__value:e.toJSON()};if(K.isDecimal(e))return{prisma__type:"decimal",prisma__value:e.toJSON()};if(Buffer.isBuffer(e))return{prisma__type:"bytes",prisma__value:e.toString("base64")};if(Sg(e))return{prisma__type:"bytes",prisma__value:Buffer.from(e).toString("base64")};if(ArrayBuffer.isView(e)){let{buffer:r,byteOffset:n,byteLength:i}=e;return{prisma__type:"bytes",prisma__value:Buffer.from(r,n,i).toString("base64")}}return typeof e=="object"&&t==="slow"?Bu(e):e}function Sg(e){return e instanceof ArrayBuffer||e instanceof SharedArrayBuffer?!0:typeof e=="object"&&e!==null?e[Symbol.toStringTag]==="ArrayBuffer"||e[Symbol.toStringTag]==="SharedArrayBuffer":!1}function Bu(e){if(typeof e!="object"||e===null)return e;if(typeof e.toJSON=="function")return e.toJSON();if(Array.isArray(e))return e.map(Uu);let t={};for(let r of Object.keys(e))t[r]=Uu(e[r]);return t}function Uu(e){return typeof e=="bigint"?e.toString():Bu(e)}var Rg=/^(\s*alter\s)/i,Qu=q("prisma:client");function Fo(e,t,r,n){if(!(e!=="postgresql"&&e!=="cockroachdb")&&r.length>0&&Rg.exec(t))throw new Error(`Running ALTER using ${n} is not supported
75
75
  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.
76
76
 
77
77
  Example:
78
78
  await prisma.$executeRawUnsafe(\`ALTER USER prisma WITH PASSWORD '\${password}'\`)
79
79
 
80
80
  More Information: https://pris.ly/d/execute-raw
81
- `)}var Lo=({clientMethod:e,activeProvider:t})=>r=>{let n="",i;if(Sn(r))n=r.sql,i={values:Ut(r.values),__prismaRawParameters__:!0};else if(Array.isArray(r)){let[o,...s]=r;n=o,i={values:Ut(s||[]),__prismaRawParameters__:!0}}else switch(t){case"sqlite":case"mysql":{n=r.sql,i={values:Ut(r.values),__prismaRawParameters__:!0};break}case"cockroachdb":case"postgresql":case"postgres":{n=r.text,i={values:Ut(r.values),__prismaRawParameters__:!0};break}case"sqlserver":{n=qu(r),i={values:Ut(r.values),__prismaRawParameters__:!0};break}default:throw new Error(`The ${t} provider does not support ${e}`)}return i?.values?Hu(`prisma.${e}(${n}, ${i.values})`):Hu(`prisma.${e}(${n})`),{query:n,parameters:i}},Gu={requestArgsToMiddlewareArgs(e){return[e.strings,...e.values]},middlewareArgsToRequestArgs(e){let[t,...r]=e;return new le(t,r)}},Wu={requestArgsToMiddlewareArgs(e){return[e]},middlewareArgsToRequestArgs(e){return e[0]}};function $o(e){return function(r,n){let i,o=(s=e)=>{try{return s===void 0||s?.kind==="itx"?i??=Ju(r(s)):Ju(r(s))}catch(a){return Promise.reject(a)}};return{get spec(){return n},then(s,a){return o().then(s,a)},catch(s){return o().catch(s)},finally(s){return o().finally(s)},requestTransaction(s){let a=o(s);return a.requestTransaction?a.requestTransaction(s):a},[Symbol.toStringTag]:"PrismaPromise"}}}function Ju(e){return typeof e.then=="function"?e:Promise.resolve(e)}var kg=ci.split(".")[0],Og={isEnabled(){return!1},getTraceParent(){return"00-10-10-00"},dispatchEngineSpans(){},getActiveContext(){},runInChildSpan(e,t){return t()}},Vo=class{isEnabled(){return this.getGlobalTracingHelper().isEnabled()}getTraceParent(t){return this.getGlobalTracingHelper().getTraceParent(t)}dispatchEngineSpans(t){return this.getGlobalTracingHelper().dispatchEngineSpans(t)}getActiveContext(){return this.getGlobalTracingHelper().getActiveContext()}runInChildSpan(t,r){return this.getGlobalTracingHelper().runInChildSpan(t,r)}getGlobalTracingHelper(){let t=globalThis[`V${kg}_PRISMA_INSTRUMENTATION`],r=globalThis.PRISMA_INSTRUMENTATION;return t?.helper??r?.helper??Og}};function Ku(){return new Vo}function zu(e,t=()=>{}){let r,n=new Promise(i=>r=i);return{then(i){return--e===0&&r(t()),i?.(n)}}}function Yu(e){return typeof e=="string"?e:e.reduce((t,r)=>{let n=typeof r=="string"?r:r.level;return n==="query"?t:t&&(r==="info"||t==="info")?"info":n},void 0)}var Xn=class{_middlewares=[];use(t){this._middlewares.push(t)}get(t){return this._middlewares[t]}has(t){return!!this._middlewares[t]}length(){return this._middlewares.length}};var Xu=j(fi());function ei(e){return typeof e.batchRequestIdx=="number"}function Zu(e){if(e.action!=="findUnique"&&e.action!=="findUniqueOrThrow")return;let t=[];return e.modelName&&t.push(e.modelName),e.query.arguments&&t.push(qo(e.query.arguments)),t.push(qo(e.query.selection)),t.join("")}function qo(e){return`(${Object.keys(e).sort().map(r=>{let n=e[r];return typeof n=="object"&&n!==null?`(${r} ${qo(n)})`:r}).join(" ")})`}var Dg={aggregate:!1,aggregateRaw:!1,createMany:!0,createManyAndReturn:!0,createOne:!0,deleteMany:!0,deleteOne:!0,executeRaw:!0,findFirst:!1,findFirstOrThrow:!1,findMany:!1,findRaw:!1,findUnique:!1,findUniqueOrThrow:!1,groupBy:!1,queryRaw:!1,runCommandRaw:!0,updateMany:!0,updateManyAndReturn:!0,updateOne:!0,upsertOne:!0};function Uo(e){return Dg[e]}var ti=class{constructor(t){this.options=t;this.batches={}}batches;tickActive=!1;request(t){let r=this.options.batchBy(t);return r?(this.batches[r]||(this.batches[r]=[],this.tickActive||(this.tickActive=!0,process.nextTick(()=>{this.dispatchBatches(),this.tickActive=!1}))),new Promise((n,i)=>{this.batches[r].push({request:t,resolve:n,reject:i})})):this.options.singleLoader(t)}dispatchBatches(){for(let t in this.batches){let r=this.batches[t];delete this.batches[t],r.length===1?this.options.singleLoader(r[0].request).then(n=>{n instanceof Error?r[0].reject(n):r[0].resolve(n)}).catch(n=>{r[0].reject(n)}):(r.sort((n,i)=>this.options.batchOrder(n.request,i.request)),this.options.batchLoader(r.map(n=>n.request)).then(n=>{if(n instanceof Error)for(let i=0;i<r.length;i++)r[i].reject(n);else for(let i=0;i<r.length;i++){let o=n[i];o instanceof Error?r[i].reject(o):r[i].resolve(o)}}).catch(n=>{for(let i=0;i<r.length;i++)r[i].reject(n)}))}}get[Symbol.toStringTag](){return"DataLoader"}};function lt(e,t){if(t===null)return t;switch(e){case"bigint":return BigInt(t);case"bytes":{let{buffer:r,byteOffset:n,byteLength:i}=Buffer.from(t,"base64");return new Uint8Array(r,n,i)}case"decimal":return new K(t);case"datetime":case"date":return new Date(t);case"time":return new Date(`1970-01-01T${t}Z`);case"bigint-array":return t.map(r=>lt("bigint",r));case"bytes-array":return t.map(r=>lt("bytes",r));case"decimal-array":return t.map(r=>lt("decimal",r));case"datetime-array":return t.map(r=>lt("datetime",r));case"date-array":return t.map(r=>lt("date",r));case"time-array":return t.map(r=>lt("time",r));default:return t}}function ri(e){let t=[],r=_g(e);for(let n=0;n<e.rows.length;n++){let i=e.rows[n],o={...r};for(let s=0;s<i.length;s++)o[e.columns[s]]=lt(e.types[s],i[s]);t.push(o)}return t}function _g(e){let t={};for(let r=0;r<e.columns.length;r++)t[e.columns[r]]=null;return t}var Ng=q("prisma:client:request_handler"),ni=class{client;dataloader;logEmitter;constructor(t,r){this.logEmitter=r,this.client=t,this.dataloader=new ti({batchLoader:Ka(async({requests:n,customDataProxyFetch:i})=>{let{transaction:o,otelParentCtx:s}=n[0],a=n.map(p=>p.protocolQuery),l=this.client._tracingHelper.getTraceParent(s),u=n.some(p=>Uo(p.protocolQuery.action));return(await this.client._engine.requestBatch(a,{traceparent:l,transaction:Mg(o),containsWrite:u,customDataProxyFetch:i})).map((p,d)=>{if(p instanceof Error)return p;try{return this.mapQueryEngineResult(n[d],p)}catch(m){return m}})}),singleLoader:async n=>{let i=n.transaction?.kind==="itx"?ec(n.transaction):void 0,o=await this.client._engine.request(n.protocolQuery,{traceparent:this.client._tracingHelper.getTraceParent(),interactiveTransaction:i,isWrite:Uo(n.protocolQuery.action),customDataProxyFetch:n.customDataProxyFetch});return this.mapQueryEngineResult(n,o)},batchBy:n=>n.transaction?.id?`transaction-${n.transaction.id}`:Zu(n.protocolQuery),batchOrder(n,i){return n.transaction?.kind==="batch"&&i.transaction?.kind==="batch"?n.transaction.index-i.transaction.index:0}})}async request(t){try{return await this.dataloader.request(t)}catch(r){let{clientMethod:n,callsite:i,transaction:o,args:s,modelName:a}=t;this.handleAndLogRequestError({error:r,clientMethod:n,callsite:i,transaction:o,args:s,modelName:a,globalOmit:t.globalOmit})}}mapQueryEngineResult({dataPath:t,unpacker:r},n){let i=n?.data,o=this.unpack(i,t,r);return process.env.PRISMA_CLIENT_GET_TIME?{data:o}:o}handleAndLogRequestError(t){try{this.handleRequestError(t)}catch(r){throw this.logEmitter&&this.logEmitter.emit("error",{message:r.message,target:t.clientMethod,timestamp:new Date}),r}}handleRequestError({error:t,clientMethod:r,callsite:n,transaction:i,args:o,modelName:s,globalOmit:a}){if(Ng(t),Fg(t,i))throw t;if(t instanceof Q&&Lg(t)){let u=tc(t.meta);bn({args:o,errors:[u],callsite:n,errorFormat:this.client._errorFormat,originalMethod:r,clientVersion:this.client._clientVersion,globalOmit:a})}let l=t.message;if(n&&(l=pn({callsite:n,originalMethod:r,isPanic:t.isPanic,showColors:this.client._errorFormat==="pretty",message:l})),l=this.sanitizeMessage(l),t.code){let u=s?{modelName:s,...t.meta}:t.meta;throw new Q(l,{code:t.code,clientVersion:this.client._clientVersion,meta:u,batchRequestIdx:t.batchRequestIdx})}else{if(t.isPanic)throw new ne(l,this.client._clientVersion);if(t instanceof X)throw new X(l,{clientVersion:this.client._clientVersion,batchRequestIdx:t.batchRequestIdx});if(t instanceof k)throw new k(l,this.client._clientVersion);if(t instanceof ne)throw new ne(l,this.client._clientVersion)}throw t.clientVersion=this.client._clientVersion,t}sanitizeMessage(t){return this.client._errorFormat&&this.client._errorFormat!=="pretty"?(0,Xu.default)(t):t}unpack(t,r,n){if(!t||(t.data&&(t=t.data),!t))return t;let i=Object.keys(t)[0],o=Object.values(t)[0],s=r.filter(u=>u!=="select"&&u!=="include"),a=Ui(o,s),l=i==="queryRaw"?ri(a):qe(a);return n?n(l):l}get[Symbol.toStringTag](){return"RequestHandler"}};function Mg(e){if(e){if(e.kind==="batch")return{kind:"batch",options:{isolationLevel:e.isolationLevel}};if(e.kind==="itx")return{kind:"itx",options:ec(e)};fe(e,"Unknown transaction kind")}}function ec(e){return{id:e.id,payload:e.payload}}function Fg(e,t){return ei(e)&&t?.kind==="batch"&&e.batchRequestIdx!==t.index}function Lg(e){return e.code==="P2009"||e.code==="P2012"}function tc(e){if(e.kind==="Union")return{kind:"Union",errors:e.errors.map(tc)};if(Array.isArray(e.selectionPath)){let[,...t]=e.selectionPath;return{...e,selectionPath:t}}return e}var rc=Kn;var ac=j(Ri());var D=class extends Error{constructor(t){super(t+`
82
- Read more at https://pris.ly/d/client-constructor`),this.name="PrismaClientConstructorValidationError"}get[Symbol.toStringTag](){return"PrismaClientConstructorValidationError"}};b(D,"PrismaClientConstructorValidationError");var nc=["datasources","datasourceUrl","errorFormat","adapter","log","transactionOptions","omit","__internal"],ic=["pretty","colorless","minimal"],oc=["info","query","warn","error"],$g={datasources:(e,{datasourceNames:t})=>{if(e){if(typeof e!="object"||Array.isArray(e))throw new D(`Invalid value ${JSON.stringify(e)} for "datasources" provided to PrismaClient constructor`);for(let[r,n]of Object.entries(e)){if(!t.includes(r)){let i=jt(r,t)||` Available datasources: ${t.join(", ")}`;throw new D(`Unknown datasource ${r} provided to PrismaClient constructor.${i}`)}if(typeof n!="object"||Array.isArray(n))throw new D(`Invalid value ${JSON.stringify(e)} for datasource "${r}" provided to PrismaClient constructor.
81
+ `)}var Lo=({clientMethod:e,activeProvider:t})=>r=>{let n="",i;if(Sn(r))n=r.sql,i={values:Ut(r.values),__prismaRawParameters__:!0};else if(Array.isArray(r)){let[o,...s]=r;n=o,i={values:Ut(s||[]),__prismaRawParameters__:!0}}else switch(t){case"sqlite":case"mysql":{n=r.sql,i={values:Ut(r.values),__prismaRawParameters__:!0};break}case"cockroachdb":case"postgresql":case"postgres":{n=r.text,i={values:Ut(r.values),__prismaRawParameters__:!0};break}case"sqlserver":{n=Vu(r),i={values:Ut(r.values),__prismaRawParameters__:!0};break}default:throw new Error(`The ${t} provider does not support ${e}`)}return i?.values?Qu(`prisma.${e}(${n}, ${i.values})`):Qu(`prisma.${e}(${n})`),{query:n,parameters:i}},Hu={requestArgsToMiddlewareArgs(e){return[e.strings,...e.values]},middlewareArgsToRequestArgs(e){let[t,...r]=e;return new le(t,r)}},Gu={requestArgsToMiddlewareArgs(e){return[e]},middlewareArgsToRequestArgs(e){return e[0]}};function $o(e){return function(r,n){let i,o=(s=e)=>{try{return s===void 0||s?.kind==="itx"?i??=Wu(r(s)):Wu(r(s))}catch(a){return Promise.reject(a)}};return{get spec(){return n},then(s,a){return o().then(s,a)},catch(s){return o().catch(s)},finally(s){return o().finally(s)},requestTransaction(s){let a=o(s);return a.requestTransaction?a.requestTransaction(s):a},[Symbol.toStringTag]:"PrismaPromise"}}}function Wu(e){return typeof e.then=="function"?e:Promise.resolve(e)}var Ig=ci.split(".")[0],kg={isEnabled(){return!1},getTraceParent(){return"00-10-10-00"},dispatchEngineSpans(){},getActiveContext(){},runInChildSpan(e,t){return t()}},Vo=class{isEnabled(){return this.getGlobalTracingHelper().isEnabled()}getTraceParent(t){return this.getGlobalTracingHelper().getTraceParent(t)}dispatchEngineSpans(t){return this.getGlobalTracingHelper().dispatchEngineSpans(t)}getActiveContext(){return this.getGlobalTracingHelper().getActiveContext()}runInChildSpan(t,r){return this.getGlobalTracingHelper().runInChildSpan(t,r)}getGlobalTracingHelper(){let t=globalThis[`V${Ig}_PRISMA_INSTRUMENTATION`],r=globalThis.PRISMA_INSTRUMENTATION;return t?.helper??r?.helper??kg}};function Ju(){return new Vo}function Ku(e,t=()=>{}){let r,n=new Promise(i=>r=i);return{then(i){return--e===0&&r(t()),i?.(n)}}}function zu(e){return typeof e=="string"?e:e.reduce((t,r)=>{let n=typeof r=="string"?r:r.level;return n==="query"?t:t&&(r==="info"||t==="info")?"info":n},void 0)}var Xn=class{_middlewares=[];use(t){this._middlewares.push(t)}get(t){return this._middlewares[t]}has(t){return!!this._middlewares[t]}length(){return this._middlewares.length}};var Zu=j(fi());function ei(e){return typeof e.batchRequestIdx=="number"}function Yu(e){if(e.action!=="findUnique"&&e.action!=="findUniqueOrThrow")return;let t=[];return e.modelName&&t.push(e.modelName),e.query.arguments&&t.push(qo(e.query.arguments)),t.push(qo(e.query.selection)),t.join("")}function qo(e){return`(${Object.keys(e).sort().map(r=>{let n=e[r];return typeof n=="object"&&n!==null?`(${r} ${qo(n)})`:r}).join(" ")})`}var Og={aggregate:!1,aggregateRaw:!1,createMany:!0,createManyAndReturn:!0,createOne:!0,deleteMany:!0,deleteOne:!0,executeRaw:!0,findFirst:!1,findFirstOrThrow:!1,findMany:!1,findRaw:!1,findUnique:!1,findUniqueOrThrow:!1,groupBy:!1,queryRaw:!1,runCommandRaw:!0,updateMany:!0,updateManyAndReturn:!0,updateOne:!0,upsertOne:!0};function Uo(e){return Og[e]}var ti=class{constructor(t){this.options=t;this.batches={}}batches;tickActive=!1;request(t){let r=this.options.batchBy(t);return r?(this.batches[r]||(this.batches[r]=[],this.tickActive||(this.tickActive=!0,process.nextTick(()=>{this.dispatchBatches(),this.tickActive=!1}))),new Promise((n,i)=>{this.batches[r].push({request:t,resolve:n,reject:i})})):this.options.singleLoader(t)}dispatchBatches(){for(let t in this.batches){let r=this.batches[t];delete this.batches[t],r.length===1?this.options.singleLoader(r[0].request).then(n=>{n instanceof Error?r[0].reject(n):r[0].resolve(n)}).catch(n=>{r[0].reject(n)}):(r.sort((n,i)=>this.options.batchOrder(n.request,i.request)),this.options.batchLoader(r.map(n=>n.request)).then(n=>{if(n instanceof Error)for(let i=0;i<r.length;i++)r[i].reject(n);else for(let i=0;i<r.length;i++){let o=n[i];o instanceof Error?r[i].reject(o):r[i].resolve(o)}}).catch(n=>{for(let i=0;i<r.length;i++)r[i].reject(n)}))}}get[Symbol.toStringTag](){return"DataLoader"}};function lt(e,t){if(t===null)return t;switch(e){case"bigint":return BigInt(t);case"bytes":{let{buffer:r,byteOffset:n,byteLength:i}=Buffer.from(t,"base64");return new Uint8Array(r,n,i)}case"decimal":return new K(t);case"datetime":case"date":return new Date(t);case"time":return new Date(`1970-01-01T${t}Z`);case"bigint-array":return t.map(r=>lt("bigint",r));case"bytes-array":return t.map(r=>lt("bytes",r));case"decimal-array":return t.map(r=>lt("decimal",r));case"datetime-array":return t.map(r=>lt("datetime",r));case"date-array":return t.map(r=>lt("date",r));case"time-array":return t.map(r=>lt("time",r));default:return t}}function ri(e){let t=[],r=Dg(e);for(let n=0;n<e.rows.length;n++){let i=e.rows[n],o={...r};for(let s=0;s<i.length;s++)o[e.columns[s]]=lt(e.types[s],i[s]);t.push(o)}return t}function Dg(e){let t={};for(let r=0;r<e.columns.length;r++)t[e.columns[r]]=null;return t}var _g=q("prisma:client:request_handler"),ni=class{client;dataloader;logEmitter;constructor(t,r){this.logEmitter=r,this.client=t,this.dataloader=new ti({batchLoader:Ka(async({requests:n,customDataProxyFetch:i})=>{let{transaction:o,otelParentCtx:s}=n[0],a=n.map(p=>p.protocolQuery),l=this.client._tracingHelper.getTraceParent(s),u=n.some(p=>Uo(p.protocolQuery.action));return(await this.client._engine.requestBatch(a,{traceparent:l,transaction:Ng(o),containsWrite:u,customDataProxyFetch:i})).map((p,d)=>{if(p instanceof Error)return p;try{return this.mapQueryEngineResult(n[d],p)}catch(f){return f}})}),singleLoader:async n=>{let i=n.transaction?.kind==="itx"?Xu(n.transaction):void 0,o=await this.client._engine.request(n.protocolQuery,{traceparent:this.client._tracingHelper.getTraceParent(),interactiveTransaction:i,isWrite:Uo(n.protocolQuery.action),customDataProxyFetch:n.customDataProxyFetch});return this.mapQueryEngineResult(n,o)},batchBy:n=>n.transaction?.id?`transaction-${n.transaction.id}`:Yu(n.protocolQuery),batchOrder(n,i){return n.transaction?.kind==="batch"&&i.transaction?.kind==="batch"?n.transaction.index-i.transaction.index:0}})}async request(t){try{return await this.dataloader.request(t)}catch(r){let{clientMethod:n,callsite:i,transaction:o,args:s,modelName:a}=t;this.handleAndLogRequestError({error:r,clientMethod:n,callsite:i,transaction:o,args:s,modelName:a,globalOmit:t.globalOmit})}}mapQueryEngineResult({dataPath:t,unpacker:r},n){let i=n?.data,o=this.unpack(i,t,r);return process.env.PRISMA_CLIENT_GET_TIME?{data:o}:o}handleAndLogRequestError(t){try{this.handleRequestError(t)}catch(r){throw this.logEmitter&&this.logEmitter.emit("error",{message:r.message,target:t.clientMethod,timestamp:new Date}),r}}handleRequestError({error:t,clientMethod:r,callsite:n,transaction:i,args:o,modelName:s,globalOmit:a}){if(_g(t),Mg(t,i))throw t;if(t instanceof Q&&Fg(t)){let u=ec(t.meta);bn({args:o,errors:[u],callsite:n,errorFormat:this.client._errorFormat,originalMethod:r,clientVersion:this.client._clientVersion,globalOmit:a})}let l=t.message;if(n&&(l=pn({callsite:n,originalMethod:r,isPanic:t.isPanic,showColors:this.client._errorFormat==="pretty",message:l})),l=this.sanitizeMessage(l),t.code){let u=s?{modelName:s,...t.meta}:t.meta;throw new Q(l,{code:t.code,clientVersion:this.client._clientVersion,meta:u,batchRequestIdx:t.batchRequestIdx})}else{if(t.isPanic)throw new ne(l,this.client._clientVersion);if(t instanceof X)throw new X(l,{clientVersion:this.client._clientVersion,batchRequestIdx:t.batchRequestIdx});if(t instanceof k)throw new k(l,this.client._clientVersion);if(t instanceof ne)throw new ne(l,this.client._clientVersion)}throw t.clientVersion=this.client._clientVersion,t}sanitizeMessage(t){return this.client._errorFormat&&this.client._errorFormat!=="pretty"?(0,Zu.default)(t):t}unpack(t,r,n){if(!t||(t.data&&(t=t.data),!t))return t;let i=Object.keys(t)[0],o=Object.values(t)[0],s=r.filter(u=>u!=="select"&&u!=="include"),a=Ui(o,s),l=i==="queryRaw"?ri(a):qe(a);return n?n(l):l}get[Symbol.toStringTag](){return"RequestHandler"}};function Ng(e){if(e){if(e.kind==="batch")return{kind:"batch",options:{isolationLevel:e.isolationLevel}};if(e.kind==="itx")return{kind:"itx",options:Xu(e)};fe(e,"Unknown transaction kind")}}function Xu(e){return{id:e.id,payload:e.payload}}function Mg(e,t){return ei(e)&&t?.kind==="batch"&&e.batchRequestIdx!==t.index}function Fg(e){return e.code==="P2009"||e.code==="P2012"}function ec(e){if(e.kind==="Union")return{kind:"Union",errors:e.errors.map(ec)};if(Array.isArray(e.selectionPath)){let[,...t]=e.selectionPath;return{...e,selectionPath:t}}return e}var tc=Kn;var sc=j(Ri());var D=class extends Error{constructor(t){super(t+`
82
+ Read more at https://pris.ly/d/client-constructor`),this.name="PrismaClientConstructorValidationError"}get[Symbol.toStringTag](){return"PrismaClientConstructorValidationError"}};b(D,"PrismaClientConstructorValidationError");var rc=["datasources","datasourceUrl","errorFormat","adapter","log","transactionOptions","omit","__internal"],nc=["pretty","colorless","minimal"],ic=["info","query","warn","error"],Lg={datasources:(e,{datasourceNames:t})=>{if(e){if(typeof e!="object"||Array.isArray(e))throw new D(`Invalid value ${JSON.stringify(e)} for "datasources" provided to PrismaClient constructor`);for(let[r,n]of Object.entries(e)){if(!t.includes(r)){let i=jt(r,t)||` Available datasources: ${t.join(", ")}`;throw new D(`Unknown datasource ${r} provided to PrismaClient constructor.${i}`)}if(typeof n!="object"||Array.isArray(n))throw new D(`Invalid value ${JSON.stringify(e)} for datasource "${r}" provided to PrismaClient constructor.
83
83
  It should have this form: { url: "CONNECTION_STRING" }`);if(n&&typeof n=="object")for(let[i,o]of Object.entries(n)){if(i!=="url")throw new D(`Invalid value ${JSON.stringify(e)} for datasource "${r}" provided to PrismaClient constructor.
84
84
  It should have this form: { url: "CONNECTION_STRING" }`);if(typeof o!="string")throw new D(`Invalid value ${JSON.stringify(o)} for datasource "${r}" provided to PrismaClient constructor.
85
85
  It should have this form: { url: "CONNECTION_STRING" }`)}}}},adapter:(e,t)=>{if(!e&&pt(t.generator)==="client")throw new D('Using engine type "client" requires a driver adapter to be provided to PrismaClient constructor.');if(e===null)return;if(e===void 0)throw new D('"adapter" property must not be undefined, use null to conditionally disable driver adapters.');if(!Zn(t).includes("driverAdapters"))throw new D('"adapter" property can only be provided to PrismaClient constructor when "driverAdapters" preview feature is enabled.');if(pt(t.generator)==="binary")throw new D('Cannot use a driver adapter with the "binary" Query Engine. Please use the "library" Query Engine.')},datasourceUrl:e=>{if(typeof e<"u"&&typeof e!="string")throw new D(`Invalid value ${JSON.stringify(e)} for "datasourceUrl" provided to PrismaClient constructor.
86
- Expected string or undefined.`)},errorFormat:e=>{if(e){if(typeof e!="string")throw new D(`Invalid value ${JSON.stringify(e)} for "errorFormat" provided to PrismaClient constructor.`);if(!ic.includes(e)){let t=jt(e,ic);throw new D(`Invalid errorFormat ${e} provided to PrismaClient constructor.${t}`)}}},log:e=>{if(!e)return;if(!Array.isArray(e))throw new D(`Invalid value ${JSON.stringify(e)} for "log" provided to PrismaClient constructor.`);function t(r){if(typeof r=="string"&&!oc.includes(r)){let n=jt(r,oc);throw new D(`Invalid log level "${r}" provided to PrismaClient constructor.${n}`)}}for(let r of e){t(r);let n={level:t,emit:i=>{let o=["stdout","event"];if(!o.includes(i)){let s=jt(i,o);throw new D(`Invalid value ${JSON.stringify(i)} for "emit" in logLevel provided to PrismaClient constructor.${s}`)}}};if(r&&typeof r=="object")for(let[i,o]of Object.entries(r))if(n[i])n[i](o);else throw new D(`Invalid property ${i} for "log" provided to PrismaClient constructor`)}},transactionOptions:e=>{if(!e)return;let t=e.maxWait;if(t!=null&&t<=0)throw new D(`Invalid value ${t} for maxWait in "transactionOptions" provided to PrismaClient constructor. maxWait needs to be greater than 0`);let r=e.timeout;if(r!=null&&r<=0)throw new D(`Invalid value ${r} for timeout in "transactionOptions" provided to PrismaClient constructor. timeout needs to be greater than 0`)},omit:(e,t)=>{if(typeof e!="object")throw new D('"omit" option is expected to be an object.');if(e===null)throw new D('"omit" option can not be `null`');let r=[];for(let[n,i]of Object.entries(e)){let o=qg(n,t.runtimeDataModel);if(!o){r.push({kind:"UnknownModel",modelKey:n});continue}for(let[s,a]of Object.entries(i)){let l=o.fields.find(u=>u.name===s);if(!l){r.push({kind:"UnknownField",modelKey:n,fieldName:s});continue}if(l.relationName){r.push({kind:"RelationInOmit",modelKey:n,fieldName:s});continue}typeof a!="boolean"&&r.push({kind:"InvalidFieldValue",modelKey:n,fieldName:s})}}if(r.length>0)throw new D(Ug(e,r))},__internal:e=>{if(!e)return;let t=["debug","engine","configOverride"];if(typeof e!="object")throw new D(`Invalid value ${JSON.stringify(e)} for "__internal" to PrismaClient constructor`);for(let[r]of Object.entries(e))if(!t.includes(r)){let n=jt(r,t);throw new D(`Invalid property ${JSON.stringify(r)} for "__internal" provided to PrismaClient constructor.${n}`)}}};function lc(e,t){for(let[r,n]of Object.entries(e)){if(!nc.includes(r)){let i=jt(r,nc);throw new D(`Unknown property ${r} provided to PrismaClient constructor.${i}`)}$g[r](n,t)}if(e.datasourceUrl&&e.datasources)throw new D('Can not use "datasourceUrl" and "datasources" options at the same time. Pick one of them')}function jt(e,t){if(t.length===0||typeof e!="string")return"";let r=Vg(e,t);return r?` Did you mean "${r}"?`:""}function Vg(e,t){if(t.length===0)return null;let r=t.map(i=>({value:i,distance:(0,ac.default)(e,i)}));r.sort((i,o)=>i.distance<o.distance?-1:1);let n=r[0];return n.distance<3?n.value:null}function qg(e,t){return sc(t.models,e)??sc(t.types,e)}function sc(e,t){let r=Object.keys(e).find(n=>Ue(n)===t);if(r)return e[r]}function Ug(e,t){let r=Tt(e);for(let o of t)switch(o.kind){case"UnknownModel":r.arguments.getField(o.modelKey)?.markAsError(),r.addErrorMessage(()=>`Unknown model name: ${o.modelKey}.`);break;case"UnknownField":r.arguments.getDeepField([o.modelKey,o.fieldName])?.markAsError(),r.addErrorMessage(()=>`Model "${o.modelKey}" does not have a field named "${o.fieldName}".`);break;case"RelationInOmit":r.arguments.getDeepField([o.modelKey,o.fieldName])?.markAsError(),r.addErrorMessage(()=>'Relations are already excluded by default and can not be specified in "omit".');break;case"InvalidFieldValue":r.arguments.getDeepFieldValue([o.modelKey,o.fieldName])?.markAsError(),r.addErrorMessage(()=>"Omit field option value must be a boolean.");break}let{message:n,args:i}=xn(r,"colorless");return`Error validating "omit" option:
86
+ Expected string or undefined.`)},errorFormat:e=>{if(e){if(typeof e!="string")throw new D(`Invalid value ${JSON.stringify(e)} for "errorFormat" provided to PrismaClient constructor.`);if(!nc.includes(e)){let t=jt(e,nc);throw new D(`Invalid errorFormat ${e} provided to PrismaClient constructor.${t}`)}}},log:e=>{if(!e)return;if(!Array.isArray(e))throw new D(`Invalid value ${JSON.stringify(e)} for "log" provided to PrismaClient constructor.`);function t(r){if(typeof r=="string"&&!ic.includes(r)){let n=jt(r,ic);throw new D(`Invalid log level "${r}" provided to PrismaClient constructor.${n}`)}}for(let r of e){t(r);let n={level:t,emit:i=>{let o=["stdout","event"];if(!o.includes(i)){let s=jt(i,o);throw new D(`Invalid value ${JSON.stringify(i)} for "emit" in logLevel provided to PrismaClient constructor.${s}`)}}};if(r&&typeof r=="object")for(let[i,o]of Object.entries(r))if(n[i])n[i](o);else throw new D(`Invalid property ${i} for "log" provided to PrismaClient constructor`)}},transactionOptions:e=>{if(!e)return;let t=e.maxWait;if(t!=null&&t<=0)throw new D(`Invalid value ${t} for maxWait in "transactionOptions" provided to PrismaClient constructor. maxWait needs to be greater than 0`);let r=e.timeout;if(r!=null&&r<=0)throw new D(`Invalid value ${r} for timeout in "transactionOptions" provided to PrismaClient constructor. timeout needs to be greater than 0`)},omit:(e,t)=>{if(typeof e!="object")throw new D('"omit" option is expected to be an object.');if(e===null)throw new D('"omit" option can not be `null`');let r=[];for(let[n,i]of Object.entries(e)){let o=Vg(n,t.runtimeDataModel);if(!o){r.push({kind:"UnknownModel",modelKey:n});continue}for(let[s,a]of Object.entries(i)){let l=o.fields.find(u=>u.name===s);if(!l){r.push({kind:"UnknownField",modelKey:n,fieldName:s});continue}if(l.relationName){r.push({kind:"RelationInOmit",modelKey:n,fieldName:s});continue}typeof a!="boolean"&&r.push({kind:"InvalidFieldValue",modelKey:n,fieldName:s})}}if(r.length>0)throw new D(qg(e,r))},__internal:e=>{if(!e)return;let t=["debug","engine","configOverride"];if(typeof e!="object")throw new D(`Invalid value ${JSON.stringify(e)} for "__internal" to PrismaClient constructor`);for(let[r]of Object.entries(e))if(!t.includes(r)){let n=jt(r,t);throw new D(`Invalid property ${JSON.stringify(r)} for "__internal" provided to PrismaClient constructor.${n}`)}}};function ac(e,t){for(let[r,n]of Object.entries(e)){if(!rc.includes(r)){let i=jt(r,rc);throw new D(`Unknown property ${r} provided to PrismaClient constructor.${i}`)}Lg[r](n,t)}if(e.datasourceUrl&&e.datasources)throw new D('Can not use "datasourceUrl" and "datasources" options at the same time. Pick one of them')}function jt(e,t){if(t.length===0||typeof e!="string")return"";let r=$g(e,t);return r?` Did you mean "${r}"?`:""}function $g(e,t){if(t.length===0)return null;let r=t.map(i=>({value:i,distance:(0,sc.default)(e,i)}));r.sort((i,o)=>i.distance<o.distance?-1:1);let n=r[0];return n.distance<3?n.value:null}function Vg(e,t){return oc(t.models,e)??oc(t.types,e)}function oc(e,t){let r=Object.keys(e).find(n=>Ue(n)===t);if(r)return e[r]}function qg(e,t){let r=Tt(e);for(let o of t)switch(o.kind){case"UnknownModel":r.arguments.getField(o.modelKey)?.markAsError(),r.addErrorMessage(()=>`Unknown model name: ${o.modelKey}.`);break;case"UnknownField":r.arguments.getDeepField([o.modelKey,o.fieldName])?.markAsError(),r.addErrorMessage(()=>`Model "${o.modelKey}" does not have a field named "${o.fieldName}".`);break;case"RelationInOmit":r.arguments.getDeepField([o.modelKey,o.fieldName])?.markAsError(),r.addErrorMessage(()=>'Relations are already excluded by default and can not be specified in "omit".');break;case"InvalidFieldValue":r.arguments.getDeepFieldValue([o.modelKey,o.fieldName])?.markAsError(),r.addErrorMessage(()=>"Omit field option value must be a boolean.");break}let{message:n,args:i}=xn(r,"colorless");return`Error validating "omit" option:
87
87
 
88
88
  ${i}
89
89
 
90
- ${n}`}function uc(e){return e.length===0?Promise.resolve([]):new Promise((t,r)=>{let n=new Array(e.length),i=null,o=!1,s=0,a=()=>{o||(s++,s===e.length&&(o=!0,i?r(i):t(n)))},l=u=>{o||(o=!0,r(u))};for(let u=0;u<e.length;u++)e[u].then(c=>{n[u]=c,a()},c=>{if(!ei(c)){l(c);return}c.batchRequestIdx===u?l(c):(i||(i=c),a())})})}var We=q("prisma:client");typeof globalThis=="object"&&(globalThis.NODE_CLIENT=!0);var jg={requestArgsToMiddlewareArgs:e=>e,middlewareArgsToRequestArgs:e=>e},Bg=Symbol.for("prisma.client.transaction.id"),Qg={id:0,nextId(){return++this.id}};function gc(e){class t{_originalClient=this;_runtimeDataModel;_requestHandler;_connectionPromise;_disconnectionPromise;_engineConfig;_accelerateEngineConfig;_clientVersion;_errorFormat;_tracingHelper;_middlewares=new Xn;_previewFeatures;_activeProvider;_globalOmit;_extensions;_engine;_appliedParent;_createPrismaPromise=$o();constructor(n){e=n?.__internal?.configOverride?.(e)??e,el(e),n&&lc(n,e);let i=new mc.EventEmitter().on("error",()=>{});this._extensions=At.empty(),this._previewFeatures=Zn(e),this._clientVersion=e.clientVersion??rc,this._activeProvider=e.activeProvider,this._globalOmit=n?.omit,this._tracingHelper=Ku();let o=e.relativeEnvPaths&&{rootEnvPath:e.relativeEnvPaths.rootEnvPath&&ii.default.resolve(e.dirname,e.relativeEnvPaths.rootEnvPath),schemaEnvPath:e.relativeEnvPaths.schemaEnvPath&&ii.default.resolve(e.dirname,e.relativeEnvPaths.schemaEnvPath)},s;if(n?.adapter){s=n.adapter;let l=e.activeProvider==="postgresql"?"postgres":e.activeProvider;if(s.provider!==l)throw new k(`The Driver Adapter \`${s.adapterName}\`, based on \`${s.provider}\`, is not compatible with the provider \`${l}\` specified in the Prisma schema.`,this._clientVersion);if(n.datasources||n.datasourceUrl!==void 0)throw new k("Custom datasource configuration is not compatible with Prisma Driver Adapters. Please define the database connection string directly in the Driver Adapter configuration.",this._clientVersion)}let a=!s&&o&&Zt(o,{conflictCheck:"none"})||e.injectableEdgeEnv?.();try{let l=n??{},u=l.__internal??{},c=u.debug===!0;c&&q.enable("prisma:client");let p=ii.default.resolve(e.dirname,e.relativePath);fc.default.existsSync(p)||(p=e.dirname),We("dirname",e.dirname),We("relativePath",e.relativePath),We("cwd",p);let d=u.engine||{};if(l.errorFormat?this._errorFormat=l.errorFormat:process.env.NODE_ENV==="production"?this._errorFormat="minimal":process.env.NO_COLOR?this._errorFormat="colorless":this._errorFormat="colorless",this._runtimeDataModel=e.runtimeDataModel,this._engineConfig={cwd:p,dirname:e.dirname,enableDebugLogs:c,allowTriggerPanic:d.allowTriggerPanic,prismaPath:d.binaryPath??void 0,engineEndpoint:d.endpoint,generator:e.generator,showColors:this._errorFormat==="pretty",logLevel:l.log&&Yu(l.log),logQueries:l.log&&!!(typeof l.log=="string"?l.log==="query":l.log.find(m=>typeof m=="string"?m==="query":m.level==="query")),env:a?.parsed??{},flags:[],engineWasm:e.engineWasm,compilerWasm:e.compilerWasm,clientVersion:e.clientVersion,engineVersion:e.engineVersion,previewFeatures:this._previewFeatures,activeProvider:e.activeProvider,inlineSchema:e.inlineSchema,overrideDatasources:tl(l,e.datasourceNames),inlineDatasources:e.inlineDatasources,inlineSchemaHash:e.inlineSchemaHash,tracingHelper:this._tracingHelper,transactionOptions:{maxWait:l.transactionOptions?.maxWait??2e3,timeout:l.transactionOptions?.timeout??5e3,isolationLevel:l.transactionOptions?.isolationLevel},logEmitter:i,isBundled:e.isBundled,adapter:s},this._accelerateEngineConfig={...this._engineConfig,accelerateUtils:{resolveDatasourceUrl:Lt,getBatchRequestPayload:Rt,prismaGraphQLToJSError:kn,PrismaClientUnknownRequestError:X,PrismaClientInitializationError:k,PrismaClientKnownRequestError:Q,debug:q("prisma:client:accelerateEngine"),engineVersion:pc.version,clientVersion:e.clientVersion}},We("clientVersion",e.clientVersion),this._engine=$u(e,this._engineConfig),this._requestHandler=new ni(this,i),l.log)for(let m of l.log){let g=typeof m=="string"?m:m.emit==="stdout"?m.level:null;g&&this.$on(g,y=>{Kt.log(`${Kt.tags[g]??""}`,y.message||y.query)})}}catch(l){throw l.clientVersion=this._clientVersion,l}return this._appliedParent=yr(this)}get[Symbol.toStringTag](){return"PrismaClient"}$use(n){this._middlewares.use(n)}$on(n,i){return n==="beforeExit"?this._engine.onBeforeExit(i):n&&this._engineConfig.logEmitter.on(n,i),this}$connect(){try{return this._engine.start()}catch(n){throw n.clientVersion=this._clientVersion,n}}async $disconnect(){try{await this._engine.stop()}catch(n){throw n.clientVersion=this._clientVersion,n}finally{ts()}}$executeRawInternal(n,i,o,s){let a=this._activeProvider;return this._request({action:"executeRaw",args:o,transaction:n,clientMethod:i,argsMapper:Lo({clientMethod:i,activeProvider:a}),callsite:Be(this._errorFormat),dataPath:[],middlewareArgsMapper:s})}$executeRaw(n,...i){return this._createPrismaPromise(o=>{if(n.raw!==void 0||n.sql!==void 0){let[s,a]=cc(n,i);return Fo(this._activeProvider,s.text,s.values,Array.isArray(n)?"prisma.$executeRaw`<SQL>`":"prisma.$executeRaw(sql`<SQL>`)"),this.$executeRawInternal(o,"$executeRaw",s,a)}throw new ee("`$executeRaw` is a tag function, please use it like the following:\n```\nconst result = await prisma.$executeRaw`UPDATE User SET cool = ${true} WHERE email = ${'user@email.com'};`\n```\n\nOr read our docs at https://www.prisma.io/docs/concepts/components/prisma-client/raw-database-access#executeraw\n",{clientVersion:this._clientVersion})})}$executeRawUnsafe(n,...i){return this._createPrismaPromise(o=>(Fo(this._activeProvider,n,i,"prisma.$executeRawUnsafe(<SQL>, [...values])"),this.$executeRawInternal(o,"$executeRawUnsafe",[n,...i])))}$runCommandRaw(n){if(e.activeProvider!=="mongodb")throw new ee(`The ${e.activeProvider} provider does not support $runCommandRaw. Use the mongodb provider.`,{clientVersion:this._clientVersion});return this._createPrismaPromise(i=>this._request({args:n,clientMethod:"$runCommandRaw",dataPath:[],action:"runCommandRaw",argsMapper:Vu,callsite:Be(this._errorFormat),transaction:i}))}async $queryRawInternal(n,i,o,s){let a=this._activeProvider;return this._request({action:"queryRaw",args:o,transaction:n,clientMethod:i,argsMapper:Lo({clientMethod:i,activeProvider:a}),callsite:Be(this._errorFormat),dataPath:[],middlewareArgsMapper:s})}$queryRaw(n,...i){return this._createPrismaPromise(o=>{if(n.raw!==void 0||n.sql!==void 0)return this.$queryRawInternal(o,"$queryRaw",...cc(n,i));throw new ee("`$queryRaw` is a tag function, please use it like the following:\n```\nconst result = await prisma.$queryRaw`SELECT * FROM User WHERE id = ${1} OR email = ${'user@email.com'};`\n```\n\nOr read our docs at https://www.prisma.io/docs/concepts/components/prisma-client/raw-database-access#queryraw\n",{clientVersion:this._clientVersion})})}$queryRawTyped(n){return this._createPrismaPromise(i=>{if(!this._hasPreviewFlag("typedSql"))throw new ee("`typedSql` preview feature must be enabled in order to access $queryRawTyped API",{clientVersion:this._clientVersion});return this.$queryRawInternal(i,"$queryRawTyped",n)})}$queryRawUnsafe(n,...i){return this._createPrismaPromise(o=>this.$queryRawInternal(o,"$queryRawUnsafe",[n,...i]))}_transactionWithArray({promises:n,options:i}){let o=Qg.nextId(),s=zu(n.length),a=n.map((l,u)=>{if(l?.[Symbol.toStringTag]!=="PrismaPromise")throw new Error("All elements of the array need to be Prisma Client promises. Hint: Please make sure you are not awaiting the Prisma client calls you intended to pass in the $transaction function.");let c=i?.isolationLevel??this._engineConfig.transactionOptions.isolationLevel,p={kind:"batch",id:o,index:u,isolationLevel:c,lock:s};return l.requestTransaction?.(p)??l});return uc(a)}async _transactionWithCallback({callback:n,options:i}){let o={traceparent:this._tracingHelper.getTraceParent()},s={maxWait:i?.maxWait??this._engineConfig.transactionOptions.maxWait,timeout:i?.timeout??this._engineConfig.transactionOptions.timeout,isolationLevel:i?.isolationLevel??this._engineConfig.transactionOptions.isolationLevel},a=await this._engine.transaction("start",o,s),l;try{let u={kind:"itx",...a};l=await n(this._createItxClient(u)),await this._engine.transaction("commit",o,a)}catch(u){throw await this._engine.transaction("rollback",o,a).catch(()=>{}),u}return l}_createItxClient(n){return he(yr(he(Va(this),[ie("_appliedParent",()=>this._appliedParent._createItxClient(n)),ie("_createPrismaPromise",()=>$o(n)),ie(Bg,()=>n.id)])),[St(Qa)])}$transaction(n,i){let o;typeof n=="function"?this._engineConfig.adapter?.adapterName==="@prisma/adapter-d1"?o=()=>{throw new Error("Cloudflare D1 does not support interactive transactions. We recommend you to refactor your queries with that limitation in mind, and use batch transactions with `prisma.$transactions([])` where applicable.")}:o=()=>this._transactionWithCallback({callback:n,options:i}):o=()=>this._transactionWithArray({promises:n,options:i});let s={name:"transaction",attributes:{method:"$transaction"}};return this._tracingHelper.runInChildSpan(s,o)}_request(n){n.otelParentCtx=this._tracingHelper.getActiveContext();let i=n.middlewareArgsMapper??jg,o={args:i.requestArgsToMiddlewareArgs(n.args),dataPath:n.dataPath,runInTransaction:!!n.transaction,action:n.action,model:n.model},s={middleware:{name:"middleware",middleware:!0,attributes:{method:"$use"},active:!1},operation:{name:"operation",attributes:{method:o.action,model:o.model,name:o.model?`${o.model}.${o.action}`:o.action}}},a=-1,l=async u=>{let c=this._middlewares.get(++a);if(c)return this._tracingHelper.runInChildSpan(s.middleware,I=>c(u,A=>(I?.end(),l(A))));let{runInTransaction:p,args:d,...m}=u,g={...n,...m};d&&(g.args=i.middlewareArgsToRequestArgs(d)),n.transaction!==void 0&&p===!1&&delete g.transaction;let y=await Ja(this,g);return g.model?Ba({result:y,modelName:g.model,args:g.args,extensions:this._extensions,runtimeDataModel:this._runtimeDataModel,globalOmit:this._globalOmit}):y};return this._tracingHelper.runInChildSpan(s.operation,()=>new dc.AsyncResource("prisma-client-request").runInAsyncScope(()=>l(o)))}async _executeRequest({args:n,clientMethod:i,dataPath:o,callsite:s,action:a,model:l,argsMapper:u,transaction:c,unpacker:p,otelParentCtx:d,customDataProxyFetch:m}){try{n=u?u(n):n;let g={name:"serialize"},y=this._tracingHelper.runInChildSpan(g,()=>An({modelName:l,runtimeDataModel:this._runtimeDataModel,action:a,args:n,clientMethod:i,callsite:s,extensions:this._extensions,errorFormat:this._errorFormat,clientVersion:this._clientVersion,previewFeatures:this._previewFeatures,globalOmit:this._globalOmit}));return q.enabled("prisma:client")&&(We("Prisma Client call:"),We(`prisma.${i}(${Ra(n)})`),We("Generated request:"),We(JSON.stringify(y,null,2)+`
91
- `)),c?.kind==="batch"&&await c.lock,this._requestHandler.request({protocolQuery:y,modelName:l,action:a,clientMethod:i,dataPath:o,callsite:s,args:n,extensions:this._extensions,transaction:c,unpacker:p,otelParentCtx:d,otelChildCtx:this._tracingHelper.getActiveContext(),globalOmit:this._globalOmit,customDataProxyFetch:m})}catch(g){throw g.clientVersion=this._clientVersion,g}}$metrics=new Ct(this);_hasPreviewFlag(n){return!!this._engineConfig.previewFeatures?.includes(n)}$applyPendingMigrations(){return this._engine.applyPendingMigrations()}$extends=qa}return t}function cc(e,t){return Hg(e)?[new le(e,t),Gu]:[e,Wu]}function Hg(e){return Array.isArray(e)&&Array.isArray(e.raw)}var Gg=new Set(["toJSON","$$typeof","asymmetricMatch",Symbol.iterator,Symbol.toStringTag,Symbol.isConcatSpreadable,Symbol.toPrimitive]);function yc(e){return new Proxy(e,{get(t,r){if(r in t)return t[r];if(!Gg.has(r))throw new TypeError(`Invalid enum value: ${String(r)}`)}})}function hc(e){Zt(e,{conflictCheck:"warn"})}0&&(module.exports={DMMF,Debug,Decimal,Extensions,MetricsClient,PrismaClientInitializationError,PrismaClientKnownRequestError,PrismaClientRustPanicError,PrismaClientUnknownRequestError,PrismaClientValidationError,Public,Sql,createParam,defineDmmfProperty,deserializeJsonResponse,deserializeRawResult,dmmfToRuntimeDataModel,empty,getPrismaClient,getRuntime,join,makeStrictEnum,makeTypedQueryFactory,objectEnumValues,raw,serializeJsonQuery,skip,sqltag,warnEnvConflicts,warnOnce});
90
+ ${n}`}function lc(e){return e.length===0?Promise.resolve([]):new Promise((t,r)=>{let n=new Array(e.length),i=null,o=!1,s=0,a=()=>{o||(s++,s===e.length&&(o=!0,i?r(i):t(n)))},l=u=>{o||(o=!0,r(u))};for(let u=0;u<e.length;u++)e[u].then(c=>{n[u]=c,a()},c=>{if(!ei(c)){l(c);return}c.batchRequestIdx===u?l(c):(i||(i=c),a())})})}var We=q("prisma:client");typeof globalThis=="object"&&(globalThis.NODE_CLIENT=!0);var Ug={requestArgsToMiddlewareArgs:e=>e,middlewareArgsToRequestArgs:e=>e},jg=Symbol.for("prisma.client.transaction.id"),Bg={id:0,nextId(){return++this.id}};function fc(e){class t{_originalClient=this;_runtimeDataModel;_requestHandler;_connectionPromise;_disconnectionPromise;_engineConfig;_accelerateEngineConfig;_clientVersion;_errorFormat;_tracingHelper;_middlewares=new Xn;_previewFeatures;_activeProvider;_globalOmit;_extensions;_engine;_appliedParent;_createPrismaPromise=$o();constructor(n){e=n?.__internal?.configOverride?.(e)??e,el(e),n&&ac(n,e);let i=new dc.EventEmitter().on("error",()=>{});this._extensions=At.empty(),this._previewFeatures=Zn(e),this._clientVersion=e.clientVersion??tc,this._activeProvider=e.activeProvider,this._globalOmit=n?.omit,this._tracingHelper=Ju();let o=e.relativeEnvPaths&&{rootEnvPath:e.relativeEnvPaths.rootEnvPath&&ii.default.resolve(e.dirname,e.relativeEnvPaths.rootEnvPath),schemaEnvPath:e.relativeEnvPaths.schemaEnvPath&&ii.default.resolve(e.dirname,e.relativeEnvPaths.schemaEnvPath)},s;if(n?.adapter){s=n.adapter;let l=e.activeProvider==="postgresql"?"postgres":e.activeProvider;if(s.provider!==l)throw new k(`The Driver Adapter \`${s.adapterName}\`, based on \`${s.provider}\`, is not compatible with the provider \`${l}\` specified in the Prisma schema.`,this._clientVersion);if(n.datasources||n.datasourceUrl!==void 0)throw new k("Custom datasource configuration is not compatible with Prisma Driver Adapters. Please define the database connection string directly in the Driver Adapter configuration.",this._clientVersion)}let a=!s&&o&&Zt(o,{conflictCheck:"none"})||e.injectableEdgeEnv?.();try{let l=n??{},u=l.__internal??{},c=u.debug===!0;c&&q.enable("prisma:client");let p=ii.default.resolve(e.dirname,e.relativePath);mc.default.existsSync(p)||(p=e.dirname),We("dirname",e.dirname),We("relativePath",e.relativePath),We("cwd",p);let d=u.engine||{};if(l.errorFormat?this._errorFormat=l.errorFormat:process.env.NODE_ENV==="production"?this._errorFormat="minimal":process.env.NO_COLOR?this._errorFormat="colorless":this._errorFormat="colorless",this._runtimeDataModel=e.runtimeDataModel,this._engineConfig={cwd:p,dirname:e.dirname,enableDebugLogs:c,allowTriggerPanic:d.allowTriggerPanic,prismaPath:d.binaryPath??void 0,engineEndpoint:d.endpoint,generator:e.generator,showColors:this._errorFormat==="pretty",logLevel:l.log&&zu(l.log),logQueries:l.log&&!!(typeof l.log=="string"?l.log==="query":l.log.find(f=>typeof f=="string"?f==="query":f.level==="query")),env:a?.parsed??{},flags:[],engineWasm:e.engineWasm,compilerWasm:e.compilerWasm,clientVersion:e.clientVersion,engineVersion:e.engineVersion,previewFeatures:this._previewFeatures,activeProvider:e.activeProvider,inlineSchema:e.inlineSchema,overrideDatasources:tl(l,e.datasourceNames),inlineDatasources:e.inlineDatasources,inlineSchemaHash:e.inlineSchemaHash,tracingHelper:this._tracingHelper,transactionOptions:{maxWait:l.transactionOptions?.maxWait??2e3,timeout:l.transactionOptions?.timeout??5e3,isolationLevel:l.transactionOptions?.isolationLevel},logEmitter:i,isBundled:e.isBundled,adapter:s},this._accelerateEngineConfig={...this._engineConfig,accelerateUtils:{resolveDatasourceUrl:Lt,getBatchRequestPayload:Rt,prismaGraphQLToJSError:kn,PrismaClientUnknownRequestError:X,PrismaClientInitializationError:k,PrismaClientKnownRequestError:Q,debug:q("prisma:client:accelerateEngine"),engineVersion:cc.version,clientVersion:e.clientVersion}},We("clientVersion",e.clientVersion),this._engine=Lu(e,this._engineConfig),this._requestHandler=new ni(this,i),l.log)for(let f of l.log){let g=typeof f=="string"?f:f.emit==="stdout"?f.level:null;g&&this.$on(g,h=>{Kt.log(`${Kt.tags[g]??""}`,h.message||h.query)})}}catch(l){throw l.clientVersion=this._clientVersion,l}return this._appliedParent=hr(this)}get[Symbol.toStringTag](){return"PrismaClient"}$use(n){this._middlewares.use(n)}$on(n,i){return n==="beforeExit"?this._engine.onBeforeExit(i):n&&this._engineConfig.logEmitter.on(n,i),this}$connect(){try{return this._engine.start()}catch(n){throw n.clientVersion=this._clientVersion,n}}async $disconnect(){try{await this._engine.stop()}catch(n){throw n.clientVersion=this._clientVersion,n}finally{ts()}}$executeRawInternal(n,i,o,s){let a=this._activeProvider;return this._request({action:"executeRaw",args:o,transaction:n,clientMethod:i,argsMapper:Lo({clientMethod:i,activeProvider:a}),callsite:Be(this._errorFormat),dataPath:[],middlewareArgsMapper:s})}$executeRaw(n,...i){return this._createPrismaPromise(o=>{if(n.raw!==void 0||n.sql!==void 0){let[s,a]=uc(n,i);return Fo(this._activeProvider,s.text,s.values,Array.isArray(n)?"prisma.$executeRaw`<SQL>`":"prisma.$executeRaw(sql`<SQL>`)"),this.$executeRawInternal(o,"$executeRaw",s,a)}throw new ee("`$executeRaw` is a tag function, please use it like the following:\n```\nconst result = await prisma.$executeRaw`UPDATE User SET cool = ${true} WHERE email = ${'user@email.com'};`\n```\n\nOr read our docs at https://www.prisma.io/docs/concepts/components/prisma-client/raw-database-access#executeraw\n",{clientVersion:this._clientVersion})})}$executeRawUnsafe(n,...i){return this._createPrismaPromise(o=>(Fo(this._activeProvider,n,i,"prisma.$executeRawUnsafe(<SQL>, [...values])"),this.$executeRawInternal(o,"$executeRawUnsafe",[n,...i])))}$runCommandRaw(n){if(e.activeProvider!=="mongodb")throw new ee(`The ${e.activeProvider} provider does not support $runCommandRaw. Use the mongodb provider.`,{clientVersion:this._clientVersion});return this._createPrismaPromise(i=>this._request({args:n,clientMethod:"$runCommandRaw",dataPath:[],action:"runCommandRaw",argsMapper:$u,callsite:Be(this._errorFormat),transaction:i}))}async $queryRawInternal(n,i,o,s){let a=this._activeProvider;return this._request({action:"queryRaw",args:o,transaction:n,clientMethod:i,argsMapper:Lo({clientMethod:i,activeProvider:a}),callsite:Be(this._errorFormat),dataPath:[],middlewareArgsMapper:s})}$queryRaw(n,...i){return this._createPrismaPromise(o=>{if(n.raw!==void 0||n.sql!==void 0)return this.$queryRawInternal(o,"$queryRaw",...uc(n,i));throw new ee("`$queryRaw` is a tag function, please use it like the following:\n```\nconst result = await prisma.$queryRaw`SELECT * FROM User WHERE id = ${1} OR email = ${'user@email.com'};`\n```\n\nOr read our docs at https://www.prisma.io/docs/concepts/components/prisma-client/raw-database-access#queryraw\n",{clientVersion:this._clientVersion})})}$queryRawTyped(n){return this._createPrismaPromise(i=>{if(!this._hasPreviewFlag("typedSql"))throw new ee("`typedSql` preview feature must be enabled in order to access $queryRawTyped API",{clientVersion:this._clientVersion});return this.$queryRawInternal(i,"$queryRawTyped",n)})}$queryRawUnsafe(n,...i){return this._createPrismaPromise(o=>this.$queryRawInternal(o,"$queryRawUnsafe",[n,...i]))}_transactionWithArray({promises:n,options:i}){let o=Bg.nextId(),s=Ku(n.length),a=n.map((l,u)=>{if(l?.[Symbol.toStringTag]!=="PrismaPromise")throw new Error("All elements of the array need to be Prisma Client promises. Hint: Please make sure you are not awaiting the Prisma client calls you intended to pass in the $transaction function.");let c=i?.isolationLevel??this._engineConfig.transactionOptions.isolationLevel,p={kind:"batch",id:o,index:u,isolationLevel:c,lock:s};return l.requestTransaction?.(p)??l});return lc(a)}async _transactionWithCallback({callback:n,options:i}){let o={traceparent:this._tracingHelper.getTraceParent()},s={maxWait:i?.maxWait??this._engineConfig.transactionOptions.maxWait,timeout:i?.timeout??this._engineConfig.transactionOptions.timeout,isolationLevel:i?.isolationLevel??this._engineConfig.transactionOptions.isolationLevel},a=await this._engine.transaction("start",o,s),l;try{let u={kind:"itx",...a};l=await n(this._createItxClient(u)),await this._engine.transaction("commit",o,a)}catch(u){throw await this._engine.transaction("rollback",o,a).catch(()=>{}),u}return l}_createItxClient(n){return ye(hr(ye(Va(this),[ie("_appliedParent",()=>this._appliedParent._createItxClient(n)),ie("_createPrismaPromise",()=>$o(n)),ie(jg,()=>n.id)])),[St(Qa)])}$transaction(n,i){let o;typeof n=="function"?this._engineConfig.adapter?.adapterName==="@prisma/adapter-d1"?o=()=>{throw new Error("Cloudflare D1 does not support interactive transactions. We recommend you to refactor your queries with that limitation in mind, and use batch transactions with `prisma.$transactions([])` where applicable.")}:o=()=>this._transactionWithCallback({callback:n,options:i}):o=()=>this._transactionWithArray({promises:n,options:i});let s={name:"transaction",attributes:{method:"$transaction"}};return this._tracingHelper.runInChildSpan(s,o)}_request(n){n.otelParentCtx=this._tracingHelper.getActiveContext();let i=n.middlewareArgsMapper??Ug,o={args:i.requestArgsToMiddlewareArgs(n.args),dataPath:n.dataPath,runInTransaction:!!n.transaction,action:n.action,model:n.model},s={middleware:{name:"middleware",middleware:!0,attributes:{method:"$use"},active:!1},operation:{name:"operation",attributes:{method:o.action,model:o.model,name:o.model?`${o.model}.${o.action}`:o.action}}},a=-1,l=async u=>{let c=this._middlewares.get(++a);if(c)return this._tracingHelper.runInChildSpan(s.middleware,I=>c(u,T=>(I?.end(),l(T))));let{runInTransaction:p,args:d,...f}=u,g={...n,...f};d&&(g.args=i.middlewareArgsToRequestArgs(d)),n.transaction!==void 0&&p===!1&&delete g.transaction;let h=await Ja(this,g);return g.model?Ba({result:h,modelName:g.model,args:g.args,extensions:this._extensions,runtimeDataModel:this._runtimeDataModel,globalOmit:this._globalOmit}):h};return this._tracingHelper.runInChildSpan(s.operation,()=>new pc.AsyncResource("prisma-client-request").runInAsyncScope(()=>l(o)))}async _executeRequest({args:n,clientMethod:i,dataPath:o,callsite:s,action:a,model:l,argsMapper:u,transaction:c,unpacker:p,otelParentCtx:d,customDataProxyFetch:f}){try{n=u?u(n):n;let g={name:"serialize"},h=this._tracingHelper.runInChildSpan(g,()=>An({modelName:l,runtimeDataModel:this._runtimeDataModel,action:a,args:n,clientMethod:i,callsite:s,extensions:this._extensions,errorFormat:this._errorFormat,clientVersion:this._clientVersion,previewFeatures:this._previewFeatures,globalOmit:this._globalOmit}));return q.enabled("prisma:client")&&(We("Prisma Client call:"),We(`prisma.${i}(${Ra(n)})`),We("Generated request:"),We(JSON.stringify(h,null,2)+`
91
+ `)),c?.kind==="batch"&&await c.lock,this._requestHandler.request({protocolQuery:h,modelName:l,action:a,clientMethod:i,dataPath:o,callsite:s,args:n,extensions:this._extensions,transaction:c,unpacker:p,otelParentCtx:d,otelChildCtx:this._tracingHelper.getActiveContext(),globalOmit:this._globalOmit,customDataProxyFetch:f})}catch(g){throw g.clientVersion=this._clientVersion,g}}$metrics=new Ct(this);_hasPreviewFlag(n){return!!this._engineConfig.previewFeatures?.includes(n)}$applyPendingMigrations(){return this._engine.applyPendingMigrations()}$extends=qa}return t}function uc(e,t){return Qg(e)?[new le(e,t),Hu]:[e,Gu]}function Qg(e){return Array.isArray(e)&&Array.isArray(e.raw)}var Hg=new Set(["toJSON","$$typeof","asymmetricMatch",Symbol.iterator,Symbol.toStringTag,Symbol.isConcatSpreadable,Symbol.toPrimitive]);function gc(e){return new Proxy(e,{get(t,r){if(r in t)return t[r];if(!Hg.has(r))throw new TypeError(`Invalid enum value: ${String(r)}`)}})}function hc(e){Zt(e,{conflictCheck:"warn"})}0&&(module.exports={DMMF,Debug,Decimal,Extensions,MetricsClient,PrismaClientInitializationError,PrismaClientKnownRequestError,PrismaClientRustPanicError,PrismaClientUnknownRequestError,PrismaClientValidationError,Public,Sql,createParam,defineDmmfProperty,deserializeJsonResponse,deserializeRawResult,dmmfToRuntimeDataModel,empty,getPrismaClient,getRuntime,join,makeStrictEnum,makeTypedQueryFactory,objectEnumValues,raw,serializeJsonQuery,skip,sqltag,warnEnvConflicts,warnOnce});
92
92
  /*! Bundled license information:
93
93
 
94
94
  @noble/hashes/utils.js: